Skip to content
Snippets Groups Projects
Verified Commit 4d72b357 authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #7640 add schema json rest

parent 204d8105
No related branches found
No related tags found
No related merge requests found
{
"swagger" : "2.0",
"info" : {
"title" : "Maarch Courrier",
"version" : "18.10",
"description" : "Documentation de l'API Maarch Courrier V18.10",
"contact" : {
"name" : "Maarch",
"email" : "info@maarch.org"
}
},
"paths" : {
"/rest/res/resource/status" : {
"put" : {
"description" : "Update documents status",
"operationId" : " Resource/controllers/ResController::updateStatus",
"parameters" : [
{
"name" : "resId",
"description" : "Documents identifier",
"in" : "body",
"required" : false,
"schema": {
"type" : "array",
"items" : {
"type" : "integer",
"example" : 101
}
}
},
{
"name" : "chrono",
"description" : "Documents chrono number",
"in" : "body",
"required" : false,
"schema": {
"type" : "array",
"items" : {
"type" : "string",
"maxLength" : 255,
"example" : "MAARCH/2017A/91"
}
}
},
{
"name" : "status",
"description" : "New status",
"in" : "body",
"required" : false,
"schema": {
"type" : "string",
"maxLength" : 10,
"default" : "COU",
"example" : "NEW"
}
},
{
"name" : "historyMessage",
"description" : "Message in history table",
"in" : "body",
"required" : false,
"schema": {
"type" : "string",
"default" : "status update",
"example" : "Document is reopen"
}
}
],
"responses" : {
"200" : {
"description" : "Status updated",
"schema": {
"type" : "object",
"properties" : {
"success" : {
"type" : "string"
}
}
},
"examples" : {
"application/json": {
"success": "success"
}
}
},
"400" : {
"description" : "Status or document not found",
"schema": {
"type" : "object",
"properties" : {
"errors" : {
"type" : "string"
}
}
},
"examples" : {
"application/json": {
"errors": "Status not found"
}
}
},
"403" : {
"description" : "Document is out of perimeter",
"schema": {
"type" : "object",
"properties" : {
"errors" : {
"type" : "string"
}
}
},
"examples" : {
"application/json": {
"errors": "Document out of perimeter"
}
}
}
}
}
},
"/rest/entities/{id}" : {
"get" : {
"description" : "Get entity informations",
"operationId" : "Entity/controllers/EntityController::getById",
"parameters" : [
{
"name" : "id",
"description" : "Entity identifier",
"in" : "path",
"required" : true,
"type" : "string",
"maxLength" : 32
}
],
"responses" : {
"200" : {
"description" : "Return entity informations",
"schema" : {
"$ref": "#/definitions/EntityRead"
},
"examples" : {
"application/json": {
"entity": {
"entity_id" : "VILLE",
"entity_label" : "Ville de Maarch-Les-Bains",
"short_label" : "Ville de Maarch-Les-Bains",
"enabled" : "Y",
"adrs_1" : "11 Bd du sud-est",
"adrs_2" : "",
"adrs_3" : "",
"zipcode" : "92000",
"city" : "Nanterre",
"country" : "FRANCE",
"email" : "info@maarchlesbains.org",
"business_id" : "",
"parent_entity_id" : "",
"entity_type" : "Direction",
"entity_path" : "",
"ldap_id" : "",
"archival_agency" : "",
"archival_agreement" : "",
"entity_full_name" : ""
}
}
}
},
"400" : {
"description" : "Entity not found",
"schema": {
"type" : "object",
"properties" : {
"errors" : {
"type" : "string"
}
}
},
"examples" : {
"application/json": {
"errors": "Entity not found"
}
}
}
}
}
}
},
"definitions" : {
"EntityRead" : {
"type" : "object",
"required" : [
"entity"
],
"properties": {
"entity" : {
"required" : [
"entity_id",
"entity_label",
"short_label",
"entity_type",
"enabled",
],
"properties" : {
"entity_id" : {
"type" : "string",
"maxLength" : 32
},
"entity_label" : {
"type" : "string",
"maxLength" : 255
},
"short_label" : {
"type" : "string",
"maxLength" : 50
},
"enabled" : {
"type" : "string",
"maxLength" : 1
},
"adrs_1" : {
"type" : "string",
"maxLength" : 255
},
"adrs_2" : {
"type" : "string",
"maxLength" : 255
},
"adrs_3" : {
"type" : "string",
"maxLength" : 255
},
"zipcode" : {
"type" : "string",
"maxLength" : 32
},
"city" : {
"type" : "string",
"maxLength" : 255
},
"country" : {
"type" : "string",
"maxLength" : 255
},
"email" : {
"type" : "string",
"maxLength" : 255
},
"business_id" : {
"type" : "string",
"maxLength" : 32
},
"parent_entity_id" : {
"type" : "string",
"maxLength" : 32
},
"entity_type" : {
"type" : "string",
"maxLength" : 64
},
"entity_path" : {
"type" : "string",
"maxLength" : 2048
},
"ldap_id" : {
"type" : "string",
"maxLength" : 255
},
"archival_agency" : {
"type" : "string",
"maxLength" : 255
},
"archival_agreement" : {
"type" : "string",
"maxLength" : 255
},
"entity_full_name" : {
"type" : "string"
}
}
}
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment