diff --git a/app/controllers/api/v1/dossiers_controller.rb b/app/controllers/api/v1/dossiers_controller.rb index 4c95e2370..3c6c432fb 100644 --- a/app/controllers/api/v1/dossiers_controller.rb +++ b/app/controllers/api/v1/dossiers_controller.rb @@ -3,33 +3,8 @@ class API::V1::DossiersController < APIController swagger_api :index do summary "Récupérer la liste de ses dossiers." - notes <<-EOS -
-
-{
-  "dossiers": [
-    {
-      "id": 1,
-      "nom_projet": "Dossier un",
-      "updated_at": "2016-02-18T12:49:41.105Z"
-    },
-    {
-      "id": 2,
-      "nom_projet": "Dossier de test",
-      "updated_at": "2016-02-08T18:36:49.394Z"
-    }
-  ],
-  "pagination": {
-    "page": 1,
-    "resultats_par_page": 12,
-    "nombre_de_page": 1
-  }
-}
-
-
- EOS - param :path, :procedure_id, :integer, :required, "Procédure ID" - param :query, :token, :integer, :required, "Admin TOKEN" + param :path, :procedure_id, :integer, "Procédure ID" + param :query, :token, :integer, "Admin TOKEN" response :ok, "Success", :Dossier response :unauthorized response :not_found @@ -37,58 +12,12 @@ class API::V1::DossiersController < APIController swagger_api :show do summary "Récupérer le détails d'un dossier." - notes <<-EOS -
-
-{
-  "dossier": {
-    "id": 2,
-    "nom_projet": "Projet de test",
-    "description": "Description de test",
-    "created_at": "2016-02-08T18:33:23.779Z",
-    "updated_at": "2016-02-08T18:36:49.394Z",
-    "archived": false,
-    "entreprise": {
-      "siren": "418166096",
-      "capital_social": 459356,
-      "numero_tva_intracommunautaire": "FR16418166096",
-      "forme_juridique": "SA à directoire (s.a.i.)",
-      "forme_juridique_code": "5699",
-      "nom_commercial": "OCTO-TECHNOLOGY",
-      "raison_sociale": "OCTO-TECHNOLOGY",
-      "siret_siege_social": "41816609600051",
-      "code_effectif_entreprise": "31",
-      "date_creation": "1998-03-31T22:00:00.000Z",
-      "nom": null,
-      "prenom": null
-    },
-    "etablissement": {
-      "siret": "41816609600051",
-      "siege_social": true,
-      "naf": "6202A",
-      "libelle_naf": "Conseil en systèmes et logiciels informatiques",
-      "adresse": "OCTO-TECHNOLOGY\\r\\n50 AV DES CHAMPS ELYSEES\\r\\n75008 PARIS 8\\r\\n",
-      "numero_voie": "50",
-      "type_voie": "AV",
-      "nom_voie": "DES CHAMPS ELYSEES",
-      "complement_adresse": null,
-      "code_postal": "75008",
-      "localite": "PARIS 8",
-      "code_insee_localite": "75108"
-    }
-  }
-}
-
-
- EOS - param :path, :procedure_id, :integer, :required, "Procédure ID" - param :path, :id, :integer, :required, "Dossier ID" - param :query, :token, :integer, :required, "Admin TOKEN" - param_list :query, :format, :string, :optional, "Format de retour", [:json, :csv] + param :path, :procedure_id, :integer, "Procédure ID" + param :path, :id, :integer, "Dossier ID" + param :query, :token, :integer, "Admin TOKEN" response :ok, "Success", :Dossier response :unauthorized response :not_found - response :not_acceptable end def index @@ -106,9 +35,6 @@ class API::V1::DossiersController < APIController format.json { render json: dossier, status: 200 } format.csv { render csv: dossier, status: 200 } end - rescue ActionController::UnknownFormat - render json: {}, status: 406 - rescue ActiveRecord::RecordNotFound => e render json: {}, status: 404 end diff --git a/app/controllers/api/v1/procedures_controller.rb b/app/controllers/api/v1/procedures_controller.rb index 435027333..4730ce72b 100644 --- a/app/controllers/api/v1/procedures_controller.rb +++ b/app/controllers/api/v1/procedures_controller.rb @@ -4,65 +4,8 @@ class API::V1::ProceduresController < APIController swagger_api :show do summary "Récupérer la liste de ses procédures." - notes <<-EOS -
-  
-{
-  "procedure": {
-    "label": "zklenkgnjzk",
-    "link": "",
-    "id": 2,
-    "description": "nzgjenjkgzenkn",
-    "organisation": "",
-    "direction": "",
-    "archived": false,
-    "geographic_information": {
-      "use_api_carto": true,
-      "quartiers_prioritaires": false,
-      "cadastre": false
-    },
-    "types_de_champ": [
-      {
-        "id": 1,
-        "libelle": "fzeknfezkz",
-        "type_champ": "text",
-        "order_place": 0,
-        "description": "zgezgze"
-      },
-      {
-        "id": 2,
-        "libelle": "gzzgeez",
-        "type_champ": "text",
-        "order_place": 1,
-        "description": "zgezeg"
-      },
-      {
-        "id": 3,
-        "libelle": "zgezgzeg",
-        "type_champ": "text",
-        "order_place": 2,
-        "description": "gezgzeg"
-      }
-    ],
-    "types_de_piece_justificative": [
-      {
-        "id": 1,
-        "libelle": "gzeezgzg",
-        "description": "gzeegz"
-      },
-      {
-        "id": 2,
-        "libelle": "gzgzeg",
-        "description": "gzeegz"
-      }
-    ]
-  }
-}
-
-
- EOS - param :path, :id, :integer, :required, "Procédure ID" - param :query, :token, :integer, :required, "Admin TOKEN" + param :path, :id, :integer, "Procédure ID" + param :query, :token, :integer, "Admin TOKEN" response :ok, "Success", :Procedure response :unauthorized response :not_found diff --git a/public/api/v1/dossiers.json b/public/api/v1/dossiers.json index d5d60ef40..6dce65d06 100644 --- a/public/api/v1/dossiers.json +++ b/public/api/v1/dossiers.json @@ -9,21 +9,20 @@ "operations": [ { "summary": "Récupérer la liste de ses dossiers.", - "notes": "
\n\n{\n  \"dossiers\": [\n    {\n      \"id\": 1,\n      \"nom_projet\": \"Dossier un\",\n      \"updated_at\": \"2016-02-18T12:49:41.105Z\"\n    },\n    {\n      \"id\": 2,\n      \"nom_projet\": \"Dossier de test\",\n      \"updated_at\": \"2016-02-08T18:36:49.394Z\"\n    }\n  ],\n  \"pagination\": {\n    \"page\": 1,\n    \"resultats_par_page\": 12,\n    \"nombre_de_page\": 1\n  }\n}\n\n
\n", "parameters": [ { "paramType": "path", "name": "procedure_id", "type": "integer", - "description": "Procédure ID", - "required": true + "description": null, + "required": false }, { "paramType": "query", "name": "token", "type": "integer", - "description": "Admin TOKEN", - "required": true + "description": null, + "required": false } ], "responseMessages": [ @@ -53,42 +52,27 @@ "operations": [ { "summary": "Récupérer le détails d'un dossier.", - "notes": "
\n\n{\n  \"dossier\": {\n    \"id\": 2,\n    \"nom_projet\": \"Projet de test\",\n    \"description\": \"Description de test\",\n    \"created_at\": \"2016-02-08T18:33:23.779Z\",\n    \"updated_at\": \"2016-02-08T18:36:49.394Z\",\n    \"archived\": false,\n    \"entreprise\": {\n      \"siren\": \"418166096\",\n      \"capital_social\": 459356,\n      \"numero_tva_intracommunautaire\": \"FR16418166096\",\n      \"forme_juridique\": \"SA à directoire (s.a.i.)\",\n      \"forme_juridique_code\": \"5699\",\n      \"nom_commercial\": \"OCTO-TECHNOLOGY\",\n      \"raison_sociale\": \"OCTO-TECHNOLOGY\",\n      \"siret_siege_social\": \"41816609600051\",\n      \"code_effectif_entreprise\": \"31\",\n      \"date_creation\": \"1998-03-31T22:00:00.000Z\",\n      \"nom\": null,\n      \"prenom\": null\n    },\n    \"etablissement\": {\n      \"siret\": \"41816609600051\",\n      \"siege_social\": true,\n      \"naf\": \"6202A\",\n      \"libelle_naf\": \"Conseil en systèmes et logiciels informatiques\",\n      \"adresse\": \"OCTO-TECHNOLOGY\\r\\n50 AV DES CHAMPS ELYSEES\\r\\n75008 PARIS 8\\r\\n\",\n      \"numero_voie\": \"50\",\n      \"type_voie\": \"AV\",\n      \"nom_voie\": \"DES CHAMPS ELYSEES\",\n      \"complement_adresse\": null,\n      \"code_postal\": \"75008\",\n      \"localite\": \"PARIS 8\",\n      \"code_insee_localite\": \"75108\"\n    }\n  }\n}\n\n
\n", "parameters": [ { "paramType": "path", "name": "procedure_id", "type": "integer", - "description": "Procédure ID", - "required": true + "description": null, + "required": false }, { "paramType": "path", "name": "id", "type": "integer", - "description": "Dossier ID", - "required": true + "description": null, + "required": false }, { "paramType": "query", "name": "token", "type": "integer", - "description": "Admin TOKEN", - "required": true - }, - { - "paramType": "query", - "name": "format", - "type": "string", - "description": "Format de retour", - "required": false, - "allowableValues": { - "valueType": "LIST", - "values": [ - "json", - "csv" - ] - } + "description": null, + "required": false } ], "responseMessages": [ @@ -106,11 +90,6 @@ "code": 404, "responseModel": null, "message": "Not Found" - }, - { - "code": 406, - "responseModel": null, - "message": "Not Acceptable" } ], "nickname": "API::V1::Dossiers#show", diff --git a/public/api/v1/procedures.json b/public/api/v1/procedures.json index 1c4d79185..ae4338a59 100644 --- a/public/api/v1/procedures.json +++ b/public/api/v1/procedures.json @@ -9,21 +9,20 @@ "operations": [ { "summary": "Récupérer la liste de ses procédures.", - "notes": "
\n  \n{\n  \"procedure\": {\n    \"label\": \"zklenkgnjzk\",\n    \"link\": \"\",\n    \"id\": 2,\n    \"description\": \"nzgjenjkgzenkn\",\n    \"organisation\": \"\",\n    \"direction\": \"\",\n    \"archived\": false,\n    \"geographic_information\": {\n      \"use_api_carto\": true,\n      \"quartiers_prioritaires\": false,\n      \"cadastre\": false\n    },\n    \"types_de_champ\": [\n      {\n        \"id\": 1,\n        \"libelle\": \"fzeknfezkz\",\n        \"type_champ\": \"text\",\n        \"order_place\": 0,\n        \"description\": \"zgezgze\"\n      },\n      {\n        \"id\": 2,\n        \"libelle\": \"gzzgeez\",\n        \"type_champ\": \"text\",\n        \"order_place\": 1,\n        \"description\": \"zgezeg\"\n      },\n      {\n        \"id\": 3,\n        \"libelle\": \"zgezgzeg\",\n        \"type_champ\": \"text\",\n        \"order_place\": 2,\n        \"description\": \"gezgzeg\"\n      }\n    ],\n    \"types_de_piece_justificative\": [\n      {\n        \"id\": 1,\n        \"libelle\": \"gzeezgzg\",\n        \"description\": \"gzeegz\"\n      },\n      {\n        \"id\": 2,\n        \"libelle\": \"gzgzeg\",\n        \"description\": \"gzeegz\"\n      }\n    ]\n  }\n}\n\n
\n", "parameters": [ { "paramType": "path", "name": "id", "type": "integer", - "description": "Procédure ID", - "required": true + "description": null, + "required": false }, { "paramType": "query", "name": "token", "type": "integer", - "description": "Admin TOKEN", - "required": true + "description": null, + "required": false } ], "responseMessages": [