├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .npmignore ├── .nvmrc ├── LICENSE.md ├── README.md ├── package-lock.json ├── package.json ├── src ├── MultipartForm.vue ├── OpenApi.vue ├── ParametersTable.vue ├── RequestForm.vue ├── ResponseDisplay.vue ├── ResponsesTable.vue ├── SchemaView.vue ├── SecurityTable.vue └── Snippet.vue ├── test ├── app.js ├── cobaRefExternal.json ├── cowpi.json ├── dataset-datafair-3.1.json ├── dataset-datafair.json ├── geocoder.json ├── index.html ├── multipart.json ├── multiple-example-koumoul.json ├── official-examples │ └── api-with-examples.json └── petstore.json └── webpack.config.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-2"], 3 | "plugins": ["transform-runtime"], 4 | "comments": false 5 | } 6 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parser: 'babel-eslint', 4 | parserOptions: { 5 | sourceType: 'module' 6 | }, 7 | // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style 8 | extends: 'standard', 9 | // required to lint *.vue files 10 | plugins: [ 11 | 'html' 12 | ], 13 | // add your custom rules here 14 | 'rules': { 15 | // allow paren-less arrow functions 16 | 'arrow-parens': 0, 17 | // allow async-await 18 | 'generator-star-spacing': 0, 19 | // allow debugger during development 20 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, 21 | // This rule is required because atom vue-format package remove the space 22 | 'space-before-function-paren': 0 23 | }, 24 | globals:{ 25 | localStorage: true 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | bundle.js 3 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /test 3 | yarn.lock 4 | webpack.config.js 5 | .editorconfig 6 | .eslintignore 7 | .eslintrc.js 8 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 20 -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 Koumoul 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenAPI viewer component for VueJS 2 | 3 | This [Vue.js](https://vuejs.org/) component is designed to easily browse and test a REST API described 4 | with the [OpenAPI 3.0 Specification](https://github.com/OAI/OpenAPI-Specification) (formerly known as Swagger Specification). This component follows Google [Material Design](https://material.google.com/) principles and relies on the [Vue Material](https://github.com/marcosmoura/vue-material) framework. It also relies on [vue-resource](https://github.com/pagekit/vue-resource) to perform API requests. 5 | 6 | See it in action : 7 | * https://koumoul.com/openapi-viewer/ 8 | 9 | ## Install 10 | 11 | npm : 12 | ```console 13 | $ npm install --save vue-openapi 14 | ``` 15 | 16 | ## Usage 17 | ```js 18 | import Vue from 'vue' 19 | import VueMaterial from 'vue-material' 20 | import OpenApi from 'vue-openapi' 21 | import 'vue-material/dist/vue-material.css' 22 | import VueResource from 'vue-resource' 23 | 24 | import jsonApi from './swagger.json' 25 | 26 | Vue.use(VueMaterial) 27 | Vue.use(VueResource) 28 | 29 | new Vue({ 30 | el: '#app', 31 | template: '', 32 | data: () => ({ 33 | jsonApi: jsonApi, 34 | queryParams: { 35 | userId: 'john_doe' 36 | }, 37 | headers: { 38 | api_key: 'my_api_key' 39 | } 40 | }), 41 | components: { 42 | OpenApi 43 | } 44 | }) 45 | ``` 46 | 47 | ## Develop 48 | 49 | Run webpack in watch mode: 50 | 51 | npm run dev 52 | 53 | Then open test/index.html in your browser. 54 | 55 | To switch between examples, modify the import "jsonApi" in test/app.js. 56 | 57 | ## License 58 | 59 | [MIT License](license.md) 60 | 61 | ## Resources 62 | 63 | * [Awesome OpenApi 3](https://github.com/Mermade/awesome-openapi3) lists various projects related to OpenApi 3.0.x 64 | * [swagger2openapi](https://github.com/Mermade/swagger2openapi) lets you convert Swagger 2.0 definitions into OpenApi 3.0.x 65 | 66 | ## Similar projects 67 | 68 | This project has been inspired by the following projects : 69 | 70 | * [angular-swagger-ui](https://github.com/Orange-OpenSource/angular-swagger-ui) 71 | * [angular-swagger-ui-material](https://github.com/darosh/angular-swagger-ui-material) 72 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@koumoul/vue-openapi", 3 | "version": "0.12.5", 4 | "description": "Display API documentation that follow the OpenAPI 3.0 Specification", 5 | "keywords": [ 6 | "vue", 7 | "material", 8 | "openapi", 9 | "api", 10 | "documentation", 11 | "swagger" 12 | ], 13 | "author": { 14 | "name": "Koumoul", 15 | "email": "support@koumoul.com", 16 | "url": "https://koumoul.com/" 17 | }, 18 | "license": "MIT", 19 | "repository": { 20 | "type": "git", 21 | "url": "https://github.com/koumoul-dev/vue-openapi.git" 22 | }, 23 | "main": "src/OpenApi.vue", 24 | "scripts": { 25 | "dev": "cross-env NODE_ENV=development webpack --watch", 26 | "test": "echo \"Error: no test specified\" && exit 1" 27 | }, 28 | "dependencies": { 29 | "@koumoul/httpsnippet": "^1.16.7", 30 | "form-data": "^2.3.3", 31 | "json-formatter-js": "^2.2.0", 32 | "json-schema-ref-parser": "^5.0.3", 33 | "json-schema-view-js": "^1.0.1", 34 | "json-stringify-pretty-compact": "^1.2.0", 35 | "marked": "^0.3.19", 36 | "vue-material": "^0.8.1", 37 | "vue-resource": "^1.5.1" 38 | }, 39 | "devDependencies": { 40 | "babel-core": "^6.26.3", 41 | "babel-eslint": "^7.1.1", 42 | "babel-loader": "^6.2.8", 43 | "babel-plugin-transform-runtime": "^6.15.0", 44 | "babel-preset-es2015": "^6.18.0", 45 | "babel-preset-stage-2": "^6.18.0", 46 | "browser-sync": "^2.24.5", 47 | "cross-env": "^5.2.0", 48 | "css-loader": "^0.26.0", 49 | "eslint": "^3.11.0", 50 | "eslint-config-standard": "^6.2.1", 51 | "eslint-friendly-formatter": "^2.0.6", 52 | "eslint-loader": "^1.6.1", 53 | "eslint-plugin-html": "^1.7.0", 54 | "eslint-plugin-promise": "^3.8.0", 55 | "eslint-plugin-standard": "^2.0.1", 56 | "file-loader": "^0.9.0", 57 | "json-loader": "^0.5.4", 58 | "style-loader": "^0.13.1", 59 | "url-loader": "^0.5.7", 60 | "vue": "^2.5.16", 61 | "vue-loader": "^11.1.4", 62 | "vue-style-loader": "^1.0.0", 63 | "vue-template-compiler": "^2.5.16", 64 | "webpack": "^2.2.0" 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/MultipartForm.vue: -------------------------------------------------------------------------------- 1 | 43 | 44 | 82 | 83 | 85 | -------------------------------------------------------------------------------- /src/OpenApi.vue: -------------------------------------------------------------------------------- 1 | 171 | 172 | 173 | 441 | 442 | 465 | -------------------------------------------------------------------------------- /src/ParametersTable.vue: -------------------------------------------------------------------------------- 1 | 60 | 61 | 77 | 78 | 80 | -------------------------------------------------------------------------------- /src/RequestForm.vue: -------------------------------------------------------------------------------- 1 | 54 | 55 | 67 | 68 | 70 | -------------------------------------------------------------------------------- /src/ResponseDisplay.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 40 | 41 | 46 | -------------------------------------------------------------------------------- /src/ResponsesTable.vue: -------------------------------------------------------------------------------- 1 | 44 | 45 | 64 | 65 | 67 | -------------------------------------------------------------------------------- /src/SchemaView.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 25 | -------------------------------------------------------------------------------- /src/SecurityTable.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 26 | 27 | 29 | -------------------------------------------------------------------------------- /src/Snippet.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 53 | 54 | 56 | -------------------------------------------------------------------------------- /test/app.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueMaterial from 'vue-material' 3 | import OpenApi from '../src/OpenApi.vue' 4 | import 'vue-material/dist/vue-material.css' 5 | import VueResource from 'vue-resource' 6 | 7 | // import jsonApi from './official-examples/api-with-examples.json' 8 | import jsonApi from './dataset-datafair-3.1.json' 9 | // import jsonApi from './multipart.json' 10 | 11 | Vue.use(VueResource) 12 | Vue.use(VueMaterial) 13 | Vue.material.registerTheme('default', { 14 | primary: 'black', 15 | accent: 'red' 16 | }) 17 | 18 | new Vue({ 19 | el: '#app', 20 | template: '', 21 | data: () => ({ 22 | jsonApi: jsonApi, 23 | queryParams: { 24 | status: ['test'] 25 | }, 26 | headers: { 27 | api_key: 'myapikey' 28 | } 29 | }), 30 | components: { 31 | OpenApi 32 | } 33 | }) 34 | -------------------------------------------------------------------------------- /test/cobaRefExternal.json: -------------------------------------------------------------------------------- 1 | { 2 | "openapi": "3.0.0", 3 | "servers": [ 4 | { 5 | "url": "http://api.nyata.com/v1", 6 | "description": "Production server version 1" 7 | }, 8 | { 9 | "url": "http://staging-api.example.com", 10 | "description": "Staging server" 11 | } 12 | ], 13 | "info": { 14 | "description": "This is a server of Tabloid Nyata.\n", 15 | "version": "0.1.0", 16 | "title": "Tabloid Nyata Advertising", 17 | "termsOfService": "http://www.ooolabs.id/tabloid-nyata-terms/", 18 | "contact": { 19 | "email": "developer@ooolabs.id" 20 | }, 21 | "license": { 22 | "name": "Proprietary license", 23 | "url": "http://www.ooolabs.id/license/" 24 | } 25 | }, 26 | "tags": [ 27 | { 28 | "name": "membership", 29 | "description": "Everything about user, group, and role" 30 | } 31 | ], 32 | "paths": { 33 | "/membership": { 34 | "$ref": "https://gist.githubusercontent.com/3mp3ri0r/307fa6314ad5a9e31a8ac9f04273a272/raw/1c7e1ba47f6a57861a41320a6f2a962352f2ac6a/membershipGetJson.json" 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /test/cowpi.json: -------------------------------------------------------------------------------- 1 | { 2 | "openapi": "3.0.0", 3 | "info": { 4 | "title": "Co-Operative Work Programmming Interface", 5 | "version": "1.0.0" 6 | }, 7 | "servers": [ 8 | { 9 | "url": "http://localhost:9000" 10 | } 11 | ], 12 | "paths": { 13 | "/tasks": { 14 | "post": { 15 | "summary": "Assign work to be performed", 16 | "requestBody": { 17 | "description": "Description of the work to be performed", 18 | "content": { 19 | "application/json;profile=http://acme.com/schemas/sow": { 20 | "schema": { 21 | "$ref": "#/components/schemas/statementOfWork" 22 | }, 23 | "examples": { 24 | "default": { 25 | "$ref": "#/components/examples/statementOfWork" 26 | } 27 | } 28 | } 29 | } 30 | }, 31 | "responses": { 32 | "201": { 33 | "description": "New task created successfully.", 34 | "headers": { 35 | "Content-Location": { 36 | "schema": { 37 | "type": "string", 38 | "format": "uri" 39 | } 40 | } 41 | } 42 | } 43 | } 44 | }, 45 | "get": { 46 | "summary": "Retreive a list of tasks a service has been asked to perform", 47 | "responses": { 48 | "200": { 49 | "description": "A list of tasks a service has been asked to peform", 50 | "content": { 51 | "application/json": { 52 | "schema": { 53 | "$ref": "#/components/schemas/statementOfWork" 54 | } 55 | } 56 | } 57 | } 58 | } 59 | } 60 | }, 61 | "/tasks/{id}": { 62 | "get": { 63 | "parameters": [ 64 | { 65 | "name": "id", 66 | "in": "path", 67 | "required": true, 68 | "schema": { 69 | "type": "string" 70 | } 71 | } 72 | ], 73 | "responses": { 74 | "200": { 75 | "description": "A document describing a statement of work", 76 | "content": { 77 | "application/json;profile=http://acme.com/schemas/sow": { 78 | "schema": { 79 | "$ref": "#/components/schemas/statementOfWork" 80 | }, 81 | "examples": { 82 | "default": { 83 | "$ref": "#/components/schemas/statementOfWork" 84 | } 85 | } 86 | } 87 | } 88 | } 89 | } 90 | } 91 | }, 92 | "/capacity": { 93 | "get": { 94 | "responses": { 95 | "200": { 96 | "description": "List of skills and the available capacity", 97 | "content": { 98 | "application/json;profile=https://acme.com/schemas/worklist": { 99 | "schema": { 100 | "$ref": "#/components/schemas/workList" 101 | } 102 | } 103 | } 104 | } 105 | } 106 | } 107 | } 108 | }, 109 | "components": { 110 | "schemas": { 111 | "statementOfWork": { 112 | "type": "object", 113 | "properties": { 114 | "statementOfWork": { 115 | "type": "array", 116 | "items": { 117 | "type": "object", 118 | "properties": { 119 | "description": { 120 | "type": "string" 121 | }, 122 | "requiredSkills": { 123 | "type": "array", 124 | "items": { 125 | "type": "string" 126 | } 127 | }, 128 | "estimatedWork": { 129 | "$ref": "#/components/schemas/workList" 130 | }, 131 | "dueDateTime": { 132 | "type": "string", 133 | "format": "DateTime" 134 | }, 135 | "completedWork": { 136 | "$ref": "#/components/schemas/workList" 137 | }, 138 | "status": { 139 | "enum": [ 140 | "Active", 141 | "Completed", 142 | "Waiting", 143 | "Cancelled" 144 | ] 145 | } 146 | }, 147 | "required": [ 148 | "description" 149 | ] 150 | } 151 | } 152 | } 153 | }, 154 | "workItem": { 155 | "type": "object", 156 | "properties": { 157 | "skill": { 158 | "type": "string" 159 | }, 160 | "minutes": { 161 | "type": "number" 162 | } 163 | } 164 | }, 165 | "workList": { 166 | "type": "array", 167 | "items": { 168 | "$ref": "#/components/schemas/workItem" 169 | } 170 | } 171 | }, 172 | "examples": { 173 | "statementOfWork": { 174 | "summary": "A description of work that needs to be performed", 175 | "value": { 176 | "description": "Do this stuff for me", 177 | "requiredSkills": [ 178 | "dance", 179 | "sing", 180 | "limbo" 181 | ], 182 | "estimatedWork": [ 183 | { 184 | "skill": "dance", 185 | "minutes": 3 186 | }, 187 | { 188 | "skill": "sing", 189 | "minutes": 7 190 | }, 191 | { 192 | "skill": "limbo", 193 | "minutes": 1 194 | } 195 | ], 196 | "dueDateTime": "2017-10-22 10:45am", 197 | "completedWork": [ 198 | { 199 | "skill": "dance", 200 | "minutes": 2 201 | } 202 | ], 203 | "status": "Active" 204 | } 205 | } 206 | } 207 | } 208 | } 209 | -------------------------------------------------------------------------------- /test/dataset-datafair-3.1.json: -------------------------------------------------------------------------------- 1 | { 2 | "openapi": "3.0.0", 3 | "info": { 4 | "title": "API du jeu de données : aides (syntaxe open api 3.1)", 5 | "version": "0.2.0", 6 | "termsOfService": "https://koumoul.com/term-of-service", 7 | "contact": { 8 | "name": "Koumoul", 9 | "url": "https://koumoul.com", 10 | "email": "support@koumoul.com" 11 | } 12 | }, 13 | "servers": [{ 14 | "url": "https://koumoul.com/s/data-fair/api/v1/datasets/aides" 15 | }], 16 | "paths": { 17 | "/": { 18 | "get": { 19 | "summary": "Récupérer les informations du jeu de données.", 20 | "operationId": "readDescription", 21 | "tags": ["Métadonnées"], 22 | "responses": { 23 | "200": { 24 | "description": "Les informations du jeu de données.", 25 | "content": { 26 | "application/json": { 27 | "schema": { 28 | "title": "Dataset", 29 | "type": "object", 30 | "additionalProperties": false, 31 | "properties": { 32 | "id": { 33 | "type": "string", 34 | "description": "Identifier of the dataset" 35 | }, 36 | "title": { 37 | "type": "string", 38 | "description": "Short title of the dataset" 39 | }, 40 | "description": { 41 | "type": "string", 42 | "description": "Detailed description of the dataset" 43 | }, 44 | "file": { 45 | "type": "object", 46 | "additionalProperties": false, 47 | "required": ["name", "size", "encoding", "mimetype"], 48 | "properties": { 49 | "name": { 50 | "type": "string", 51 | "description": "Name of the file that was used to create or update this dataset" 52 | }, 53 | "size": { 54 | "type": "number", 55 | "description": "Size of the file on disk" 56 | }, 57 | "encoding": { 58 | "type": "string", 59 | "description": "Encoding of the file" 60 | }, 61 | "mimetype": { 62 | "type": "string", 63 | "enum": ["text/csv"], 64 | "description": "Mime type of the file" 65 | }, 66 | "schema": { 67 | "type": "array", 68 | "description": "JSON schema of the fields in the file" 69 | }, 70 | "props": { 71 | "type": "object", 72 | "additionalProperties": false, 73 | "properties": { 74 | "numLines": { 75 | "type": "number", 76 | "description": "Number of lines this file has." 77 | }, 78 | "linesDelimiter": { 79 | "type": "string", 80 | "description": "New line character or characters (can be \r\n))" 81 | }, 82 | "fieldsDelimiter": { 83 | "type": "string", 84 | "description": "Fields delimiter" 85 | }, 86 | "escapeChar": { 87 | "type": "string", 88 | "description": "Character used to escape string" 89 | } 90 | } 91 | } 92 | } 93 | }, 94 | "createdBy": { 95 | "type": "string", 96 | "description": "Id of the account that created this dataset" 97 | }, 98 | "updatedBy": { 99 | "type": "string", 100 | "description": "Id of the account that last updated this dataset" 101 | }, 102 | "createdAt": { 103 | "type": "string", 104 | "description": "Creation date of this dataset", 105 | "format": "date-time" 106 | }, 107 | "updatedAt": { 108 | "type": "string", 109 | "description": "Date of the last update for this dataset", 110 | "format": "date-time" 111 | }, 112 | "owner": { 113 | "type": "object", 114 | "additionalProperties": false, 115 | "required": ["type", "id"], 116 | "properties": { 117 | "type": { 118 | "type": "string", 119 | "enum": ["user", "organization"], 120 | "description": "If the owner is a user or an organization" 121 | }, 122 | "id": { 123 | "type": "string", 124 | "description": "Identifier of the owner of this dataset" 125 | } 126 | } 127 | }, 128 | "status": { 129 | "type": "string", 130 | "enum": ["loaded", "analyzed", "schematized", "indexed", "extended", "finalized", "error"], 131 | "description": "The processing steps of a dataset." 132 | }, 133 | "schema": { 134 | "type": "array", 135 | "description": "JSON schema of the dataset" 136 | }, 137 | "count": { 138 | "type": "number", 139 | "description": "The number of indexed documents of a dataset" 140 | }, 141 | "bbox": { 142 | "type": "array", 143 | "description": "The spatial coverage of this dataset, in bounding box format.", 144 | "items": { 145 | "type": "number" 146 | } 147 | }, 148 | "license": { 149 | "type": "object", 150 | "additionalProperties": false, 151 | "required": ["title", "href"], 152 | "properties": { 153 | "title": { 154 | "type": "string", 155 | "description": "Short title for the license" 156 | }, 157 | "href": { 158 | "type": "string", 159 | "description": "The URL where the license can be read" 160 | } 161 | } 162 | }, 163 | "origin": { 164 | "type": "string", 165 | "description": "The URL where the original data can be found" 166 | }, 167 | "extensions": { 168 | "type": "array", 169 | "description": "Définition des enrichissements appliqués à ce jeu de données", 170 | "items": { 171 | "type": "object", 172 | "properties": { 173 | "active": { 174 | "type": "boolean", 175 | "description": "Toggle on and off the extension" 176 | }, 177 | "forceNext": { 178 | "type": "boolean", 179 | "description": "Set to true to force overwriting extension results on next indexing." 180 | }, 181 | "progress": { 182 | "type": "number", 183 | "description": "From 0 to 1 based on progress of the extension." 184 | }, 185 | "error": { 186 | "type": "string", 187 | "description": "An error that occured during the last time the extension was run" 188 | }, 189 | "remoteService": { 190 | "type": "string", 191 | "description": "L'identifiant du service distant utilisé pour l'enrichissement" 192 | }, 193 | "action": { 194 | "type": "string", 195 | "description": "L'identifiant de l'action du service distant à utiliser pour l'enrichissement" 196 | }, 197 | "select": { 198 | "type": "array", 199 | "description": "La liste des champs à sélectionner dans le retour du service distant. Tous les champs si absent ou vide.", 200 | "items": { 201 | "type": "string" 202 | } 203 | } 204 | } 205 | } 206 | } 207 | } 208 | } 209 | } 210 | } 211 | } 212 | } 213 | }, 214 | "patch": { 215 | "summary": "Mettre à jour les informations du jeu de données.", 216 | "operationId": "writeDescription", 217 | "tags": ["Métadonnées"], 218 | "requestBody": { 219 | "description": "Fichier à charger et informations de propriété", 220 | "required": true, 221 | "content": { 222 | "application/json": { 223 | "schema": { 224 | "title": "Dataset", 225 | "type": "object", 226 | "additionalProperties": false, 227 | "properties": { 228 | "id": { 229 | "type": "string", 230 | "description": "Identifier of the dataset" 231 | }, 232 | "title": { 233 | "type": "string", 234 | "description": "Short title of the dataset" 235 | }, 236 | "description": { 237 | "type": "string", 238 | "description": "Detailed description of the dataset" 239 | }, 240 | "file": { 241 | "type": "object", 242 | "additionalProperties": false, 243 | "required": ["name", "size", "encoding", "mimetype"], 244 | "properties": { 245 | "name": { 246 | "type": "string", 247 | "description": "Name of the file that was used to create or update this dataset" 248 | }, 249 | "size": { 250 | "type": "number", 251 | "description": "Size of the file on disk" 252 | }, 253 | "encoding": { 254 | "type": "string", 255 | "description": "Encoding of the file" 256 | }, 257 | "mimetype": { 258 | "type": "string", 259 | "enum": ["text/csv"], 260 | "description": "Mime type of the file" 261 | }, 262 | "schema": { 263 | "type": "array", 264 | "description": "JSON schema of the fields in the file" 265 | }, 266 | "props": { 267 | "type": "object", 268 | "additionalProperties": false, 269 | "properties": { 270 | "numLines": { 271 | "type": "number", 272 | "description": "Number of lines this file has." 273 | }, 274 | "linesDelimiter": { 275 | "type": "string", 276 | "description": "New line character or characters (can be \r\n))" 277 | }, 278 | "fieldsDelimiter": { 279 | "type": "string", 280 | "description": "Fields delimiter" 281 | }, 282 | "escapeChar": { 283 | "type": "string", 284 | "description": "Character used to escape string" 285 | } 286 | } 287 | } 288 | } 289 | }, 290 | "createdBy": { 291 | "type": "string", 292 | "description": "Id of the account that created this dataset" 293 | }, 294 | "updatedBy": { 295 | "type": "string", 296 | "description": "Id of the account that last updated this dataset" 297 | }, 298 | "createdAt": { 299 | "type": "string", 300 | "description": "Creation date of this dataset", 301 | "format": "date-time" 302 | }, 303 | "updatedAt": { 304 | "type": "string", 305 | "description": "Date of the last update for this dataset", 306 | "format": "date-time" 307 | }, 308 | "owner": { 309 | "type": "object", 310 | "additionalProperties": false, 311 | "required": ["type", "id"], 312 | "properties": { 313 | "type": { 314 | "type": "string", 315 | "enum": ["user", "organization"], 316 | "description": "If the owner is a user or an organization" 317 | }, 318 | "id": { 319 | "type": "string", 320 | "description": "Identifier of the owner of this dataset" 321 | } 322 | } 323 | }, 324 | "status": { 325 | "type": "string", 326 | "enum": ["loaded", "analyzed", "schematized", "indexed", "extended", "finalized", "error"], 327 | "description": "The processing steps of a dataset." 328 | }, 329 | "schema": { 330 | "type": "array", 331 | "description": "JSON schema of the dataset" 332 | }, 333 | "count": { 334 | "type": "number", 335 | "description": "The number of indexed documents of a dataset" 336 | }, 337 | "bbox": { 338 | "type": "array", 339 | "description": "The spatial coverage of this dataset, in bounding box format.", 340 | "items": { 341 | "type": "number" 342 | } 343 | }, 344 | "license": { 345 | "type": "object", 346 | "additionalProperties": false, 347 | "required": ["title", "href"], 348 | "properties": { 349 | "title": { 350 | "type": "string", 351 | "description": "Short title for the license" 352 | }, 353 | "href": { 354 | "type": "string", 355 | "description": "The URL where the license can be read" 356 | } 357 | } 358 | }, 359 | "origin": { 360 | "type": "string", 361 | "description": "The URL where the original data can be found" 362 | }, 363 | "extensions": { 364 | "type": "array", 365 | "description": "Définition des enrichissements appliqués à ce jeu de données", 366 | "items": { 367 | "type": "object", 368 | "properties": { 369 | "active": { 370 | "type": "boolean", 371 | "description": "Toggle on and off the extension" 372 | }, 373 | "forceNext": { 374 | "type": "boolean", 375 | "description": "Set to true to force overwriting extension results on next indexing." 376 | }, 377 | "progress": { 378 | "type": "number", 379 | "description": "From 0 to 1 based on progress of the extension." 380 | }, 381 | "error": { 382 | "type": "string", 383 | "description": "An error that occured during the last time the extension was run" 384 | }, 385 | "remoteService": { 386 | "type": "string", 387 | "description": "L'identifiant du service distant utilisé pour l'enrichissement" 388 | }, 389 | "action": { 390 | "type": "string", 391 | "description": "L'identifiant de l'action du service distant à utiliser pour l'enrichissement" 392 | }, 393 | "select": { 394 | "type": "array", 395 | "description": "La liste des champs à sélectionner dans le retour du service distant. Tous les champs si absent ou vide.", 396 | "items": { 397 | "type": "string" 398 | } 399 | } 400 | } 401 | } 402 | } 403 | } 404 | } 405 | } 406 | } 407 | }, 408 | "responses": { 409 | "200": { 410 | "description": "Les informations du jeu de données.", 411 | "content": { 412 | "application/json": { 413 | "schema": { 414 | "title": "Dataset", 415 | "type": "object", 416 | "additionalProperties": false, 417 | "properties": { 418 | "id": { 419 | "type": "string", 420 | "description": "Identifier of the dataset" 421 | }, 422 | "title": { 423 | "type": "string", 424 | "description": "Short title of the dataset" 425 | }, 426 | "description": { 427 | "type": "string", 428 | "description": "Detailed description of the dataset" 429 | }, 430 | "file": { 431 | "type": "object", 432 | "additionalProperties": false, 433 | "required": ["name", "size", "encoding", "mimetype"], 434 | "properties": { 435 | "name": { 436 | "type": "string", 437 | "description": "Name of the file that was used to create or update this dataset" 438 | }, 439 | "size": { 440 | "type": "number", 441 | "description": "Size of the file on disk" 442 | }, 443 | "encoding": { 444 | "type": "string", 445 | "description": "Encoding of the file" 446 | }, 447 | "mimetype": { 448 | "type": "string", 449 | "enum": ["text/csv"], 450 | "description": "Mime type of the file" 451 | }, 452 | "schema": { 453 | "type": "array", 454 | "description": "JSON schema of the fields in the file" 455 | }, 456 | "props": { 457 | "type": "object", 458 | "additionalProperties": false, 459 | "properties": { 460 | "numLines": { 461 | "type": "number", 462 | "description": "Number of lines this file has." 463 | }, 464 | "linesDelimiter": { 465 | "type": "string", 466 | "description": "New line character or characters (can be \r\n))" 467 | }, 468 | "fieldsDelimiter": { 469 | "type": "string", 470 | "description": "Fields delimiter" 471 | }, 472 | "escapeChar": { 473 | "type": "string", 474 | "description": "Character used to escape string" 475 | } 476 | } 477 | } 478 | } 479 | }, 480 | "createdBy": { 481 | "type": "string", 482 | "description": "Id of the account that created this dataset" 483 | }, 484 | "updatedBy": { 485 | "type": "string", 486 | "description": "Id of the account that last updated this dataset" 487 | }, 488 | "createdAt": { 489 | "type": "string", 490 | "description": "Creation date of this dataset", 491 | "format": "date-time" 492 | }, 493 | "updatedAt": { 494 | "type": "string", 495 | "description": "Date of the last update for this dataset", 496 | "format": "date-time" 497 | }, 498 | "owner": { 499 | "type": "object", 500 | "additionalProperties": false, 501 | "required": ["type", "id"], 502 | "properties": { 503 | "type": { 504 | "type": "string", 505 | "enum": ["user", "organization"], 506 | "description": "If the owner is a user or an organization" 507 | }, 508 | "id": { 509 | "type": "string", 510 | "description": "Identifier of the owner of this dataset" 511 | } 512 | } 513 | }, 514 | "status": { 515 | "type": "string", 516 | "enum": ["loaded", "analyzed", "schematized", "indexed", "extended", "finalized", "error"], 517 | "description": "The processing steps of a dataset." 518 | }, 519 | "schema": { 520 | "type": "array", 521 | "description": "JSON schema of the dataset" 522 | }, 523 | "count": { 524 | "type": "number", 525 | "description": "The number of indexed documents of a dataset" 526 | }, 527 | "bbox": { 528 | "type": "array", 529 | "description": "The spatial coverage of this dataset, in bounding box format.", 530 | "items": { 531 | "type": "number" 532 | } 533 | }, 534 | "license": { 535 | "type": "object", 536 | "additionalProperties": false, 537 | "required": ["title", "href"], 538 | "properties": { 539 | "title": { 540 | "type": "string", 541 | "description": "Short title for the license" 542 | }, 543 | "href": { 544 | "type": "string", 545 | "description": "The URL where the license can be read" 546 | } 547 | } 548 | }, 549 | "origin": { 550 | "type": "string", 551 | "description": "The URL where the original data can be found" 552 | }, 553 | "extensions": { 554 | "type": "array", 555 | "description": "Définition des enrichissements appliqués à ce jeu de données", 556 | "items": { 557 | "type": "object", 558 | "properties": { 559 | "active": { 560 | "type": "boolean", 561 | "description": "Toggle on and off the extension" 562 | }, 563 | "forceNext": { 564 | "type": "boolean", 565 | "description": "Set to true to force overwriting extension results on next indexing." 566 | }, 567 | "progress": { 568 | "type": "number", 569 | "description": "From 0 to 1 based on progress of the extension." 570 | }, 571 | "error": { 572 | "type": "string", 573 | "description": "An error that occured during the last time the extension was run" 574 | }, 575 | "remoteService": { 576 | "type": "string", 577 | "description": "L'identifiant du service distant utilisé pour l'enrichissement" 578 | }, 579 | "action": { 580 | "type": "string", 581 | "description": "L'identifiant de l'action du service distant à utiliser pour l'enrichissement" 582 | }, 583 | "select": { 584 | "type": "array", 585 | "description": "La liste des champs à sélectionner dans le retour du service distant. Tous les champs si absent ou vide.", 586 | "items": { 587 | "type": "string" 588 | } 589 | } 590 | } 591 | } 592 | } 593 | } 594 | } 595 | } 596 | } 597 | } 598 | } 599 | } 600 | }, 601 | "/lines": { 602 | "get": { 603 | "summary": "Requêter les lignes du jeu de données.", 604 | "operationId": "readLines", 605 | "tags": ["Données"], 606 | "parameters": [{ 607 | "in": "query", 608 | "name": "page", 609 | "description": "Le numéro de la page (indice de la pagination). Débute à 1.", 610 | "required": false, 611 | "schema": { 612 | "default": 1, 613 | "type": "integer" 614 | } 615 | }, { 616 | "in": "query", 617 | "name": "size", 618 | "description": "Le nombre de résultats à retourner (taille de la pagination). 20 par défaut.", 619 | "required": false, 620 | "schema": { 621 | "default": 20, 622 | "type": "integer", 623 | "max": 10000 624 | } 625 | }, { 626 | "in": "query", 627 | "name": "q", 628 | "description": "\n Champ de recherche simple. Ce paramètre peut-être utilisé pour exposer une fonctionalité de recherche textuelle riche aux utilisateurs sans risque de créer des erreurs de syntaxe.\n\n Exemple: \"open data\" | \"open source\"\n\n Pour plus d'information voir la documentation [ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html) correspondante.\n ", 629 | "required": false, 630 | "schema": { 631 | "type": "string" 632 | } 633 | }, { 634 | "in": "query", 635 | "name": "select", 636 | "description": "La liste des champs à retourner", 637 | "required": false, 638 | "schema": { 639 | "default": ["*"], 640 | "type": "array", 641 | "items": { 642 | "type": "string", 643 | "enum": ["id_aid", "aid_nom", "aid_objet", "aid_operations_el", "aid_conditions", "aid_montant", "aid_benef", "aid_validation", "couverture_geo", "horodatage", "id_domaine", "handicapes", "femmes", "seniors", "jeunes", "date_fin", "status", "maj", "nb_org", "complements", "effectif", "duree_projet", "age_entreprise", "cache_indexation", "projets", "profils", "natures", "territoires", "contacts", "financeurs"] 644 | } 645 | }, 646 | "style": "form", 647 | "explode": false 648 | }, { 649 | "in": "query", 650 | "name": "sort", 651 | "description": "\n Le tri à effectuer sous forme d'une liste de clés de champs séparées par des virgules.\n\n Par défaut le tri est ascendant, si un nom de champ est préfixé par un \"-\" alors le tri sera descendant.\n\n Exemple: ma_colonne,-ma_colonne2", 652 | "required": false, 653 | "default": [], 654 | "schema": { 655 | "type": "array", 656 | "items": { 657 | "type": "string", 658 | "enum": ["id_aid", "aid_validation", "couverture_geo", "id_domaine", "handicapes", "femmes", "seniors", "jeunes", "status", "nb_org", "complements", "effectif", "duree_projet", "age_entreprise", "cache_indexation", "projets", "profils", "natures", "contacts", "financeurs"] 659 | } 660 | }, 661 | "style": "form", 662 | "explode": false 663 | }, { 664 | "in": "query", 665 | "name": "qs", 666 | "description": "\n Champ de filtre et recherche textuelle avancé. Ce paramètre permet d'effectuer des requêtes complexes sur la source de données. Vous pouvez spécifier des filtres par champs, créer des combinaisons logiques à volonté, etc.\n\n Exemple: ma_colonne:\"du texte\" AND ma_colonne2:valeur\n\n Pour plus d'information voir la documentation [ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html) correspondante.\n ", 667 | "required": false, 668 | "schema": { 669 | "type": "string" 670 | } 671 | }, { 672 | "in": "query", 673 | "name": "bbox", 674 | "description": "Un filtre pour restreindre les résultats à une zone géographique. Le format est 'gauche,bas,droite,haut' autrement dit 'lonMin,latMin,lonMax,latMax'.", 675 | "required": false, 676 | "schema": { 677 | "type": "array", 678 | "items": { 679 | "type": "number" 680 | } 681 | }, 682 | "style": "form", 683 | "explode": false 684 | }, { 685 | "in": "query", 686 | "name": "xyz", 687 | "description": "\n Un filtre pour restreindre les résultats à une zone géographique avec les paramètres standards de tuiles géographiques x,y et z.\n\n Le format est 'x,y,z'.\n ", 688 | "required": false, 689 | "schema": { 690 | "type": "array", 691 | "items": { 692 | "type": "number" 693 | } 694 | }, 695 | "style": "form", 696 | "explode": false 697 | }], 698 | "responses": { 699 | "200": { 700 | "description": "Le résultat de la requête.", 701 | "content": { 702 | "application/json": { 703 | "schema": { 704 | "type": "object", 705 | "properties": { 706 | "total": { 707 | "type": "integer", 708 | "description": "Le nombre total de résultat si on ignore la pagination" 709 | }, 710 | "results": { 711 | "type": "array", 712 | "description": "Le tableau de résultats.", 713 | "items": { 714 | "type": "object", 715 | "properties": [{ 716 | "key": "id_aid", 717 | "type": "integer", 718 | "x-originalName": "id_aid", 719 | "x-cardinality": 1668 720 | }, { 721 | "key": "aid_nom", 722 | "type": "string", 723 | "x-originalName": "aid_nom" 724 | }, { 725 | "key": "aid_objet", 726 | "type": "string", 727 | "x-originalName": "aid_objet" 728 | }, { 729 | "key": "aid_operations_el", 730 | "type": "string", 731 | "x-originalName": "aid_operations_el" 732 | }, { 733 | "key": "aid_conditions", 734 | "type": "string", 735 | "x-originalName": "aid_conditions" 736 | }, { 737 | "key": "aid_montant", 738 | "type": "string", 739 | "x-originalName": "aid_montant" 740 | }, { 741 | "key": "aid_benef", 742 | "type": "string", 743 | "x-originalName": "aid_benef" 744 | }, { 745 | "key": "aid_validation", 746 | "type": "string", 747 | "x-originalName": "aid_validation", 748 | "format": "date", 749 | "x-cardinality": 198 750 | }, { 751 | "key": "couverture_geo", 752 | "type": "integer", 753 | "x-originalName": "couverture_geo", 754 | "x-cardinality": 3, 755 | "enum": [1, 2, 3] 756 | }, { 757 | "key": "horodatage", 758 | "type": "string", 759 | "x-originalName": "horodatage" 760 | }, { 761 | "key": "id_domaine", 762 | "type": "boolean", 763 | "x-originalName": "id_domaine", 764 | "x-cardinality": 2, 765 | "enum": [0, 1] 766 | }, { 767 | "key": "handicapes", 768 | "type": "boolean", 769 | "x-originalName": "handicapes", 770 | "x-cardinality": 1, 771 | "enum": [0] 772 | }, { 773 | "key": "femmes", 774 | "type": "boolean", 775 | "x-originalName": "femmes", 776 | "x-cardinality": 1, 777 | "enum": [0] 778 | }, { 779 | "key": "seniors", 780 | "type": "boolean", 781 | "x-originalName": "seniors", 782 | "x-cardinality": 1, 783 | "enum": [0] 784 | }, { 785 | "key": "jeunes", 786 | "type": "boolean", 787 | "x-originalName": "jeunes", 788 | "x-cardinality": 1, 789 | "enum": [0] 790 | }, { 791 | "key": "date_fin", 792 | "type": "string", 793 | "x-originalName": "date_fin" 794 | }, { 795 | "key": "status", 796 | "type": "boolean", 797 | "x-originalName": "status", 798 | "x-cardinality": 1, 799 | "enum": [1] 800 | }, { 801 | "key": "maj", 802 | "type": "string", 803 | "x-originalName": "maj" 804 | }, { 805 | "key": "nb_org", 806 | "type": "integer", 807 | "x-originalName": "nb_org", 808 | "x-cardinality": 19 809 | }, { 810 | "key": "complements", 811 | "type": "boolean", 812 | "x-originalName": "complements", 813 | "x-cardinality": 0, 814 | "enum": [] 815 | }, { 816 | "key": "effectif", 817 | "type": "string", 818 | "x-originalName": "effectif", 819 | "format": "uri-reference", 820 | "x-cardinality": 11 821 | }, { 822 | "key": "duree_projet", 823 | "type": "boolean", 824 | "x-originalName": "duree_projet", 825 | "x-cardinality": 1, 826 | "enum": [0] 827 | }, { 828 | "key": "age_entreprise", 829 | "type": "string", 830 | "x-originalName": "age_entreprise", 831 | "format": "uri-reference", 832 | "x-cardinality": 3, 833 | "enum": ["1,2", "1", "2"] 834 | }, { 835 | "key": "cache_indexation", 836 | "type": "boolean", 837 | "x-originalName": "cache_indexation", 838 | "x-cardinality": 0, 839 | "enum": [] 840 | }, { 841 | "key": "projets", 842 | "type": "string", 843 | "x-originalName": "projets", 844 | "format": "uri-reference", 845 | "x-cardinality": 481 846 | }, { 847 | "key": "profils", 848 | "type": "string", 849 | "x-originalName": "profils", 850 | "format": "uri-reference", 851 | "x-cardinality": 232 852 | }, { 853 | "key": "natures", 854 | "type": "string", 855 | "x-originalName": "natures", 856 | "format": "uri-reference", 857 | "x-cardinality": 45 858 | }, { 859 | "key": "territoires", 860 | "type": "string", 861 | "x-originalName": "territoires" 862 | }, { 863 | "key": "contacts", 864 | "type": "string", 865 | "x-originalName": "contacts", 866 | "format": "uri-reference", 867 | "x-cardinality": 817 868 | }, { 869 | "key": "financeurs", 870 | "type": "string", 871 | "x-originalName": "financeurs", 872 | "format": "uri-reference", 873 | "x-cardinality": 467 874 | }] 875 | } 876 | } 877 | } 878 | } 879 | } 880 | } 881 | } 882 | } 883 | } 884 | }, 885 | "/values_agg": { 886 | "get": { 887 | "summary": "Récupérer des informations agrégées en fonction des valeurs d'un champ.", 888 | "operationId": "getValuesAgg", 889 | "tags": ["Données"], 890 | "parameters": [{ 891 | "in": "query", 892 | "name": "field", 893 | "description": "Le champ en fonction des valeurs duquel grouper les lignes du jeu de donénes", 894 | "required": true, 895 | "schema": { 896 | "type": "string", 897 | "enum": ["id_aid", "aid_validation", "couverture_geo", "id_domaine", "handicapes", "femmes", "seniors", "jeunes", "status", "nb_org", "complements", "effectif", "duree_projet", "age_entreprise", "cache_indexation", "projets", "profils", "natures", "contacts", "financeurs"] 898 | } 899 | }, { 900 | "in": "query", 901 | "name": "metric", 902 | "description": "La métrique à appliquer", 903 | "required": false, 904 | "schema": { 905 | "type": "string", 906 | "enum": ["avg", "sum", "min", "max"] 907 | } 908 | }, { 909 | "in": "query", 910 | "name": "metric_field", 911 | "description": "Le champ sur lequel effectuer la calcul de métrique", 912 | "required": false, 913 | "schema": { 914 | "type": "string", 915 | "enum": [] 916 | } 917 | }, { 918 | "in": "query", 919 | "name": "agg_size", 920 | "description": "Le nombre de buckets pour l'agrégation (défaut 20)", 921 | "required": false, 922 | "schema": { 923 | "default": 20, 924 | "type": "integer", 925 | "max": 10000 926 | } 927 | }, { 928 | "in": "query", 929 | "name": "size", 930 | "description": "Le nombre de résultats à retourner (taille de la pagination). 20 par défaut.", 931 | "required": false, 932 | "schema": { 933 | "default": 20, 934 | "type": "integer", 935 | "max": 10000 936 | } 937 | }, { 938 | "in": "query", 939 | "name": "q", 940 | "description": "\n Champ de recherche simple. Ce paramètre peut-être utilisé pour exposer une fonctionalité de recherche textuelle riche aux utilisateurs sans risque de créer des erreurs de syntaxe.\n\n Exemple: \"open data\" | \"open source\"\n\n Pour plus d'information voir la documentation [ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html) correspondante.\n ", 941 | "required": false, 942 | "schema": { 943 | "type": "string" 944 | } 945 | }, { 946 | "in": "query", 947 | "name": "select", 948 | "description": "La liste des champs à retourner", 949 | "required": false, 950 | "schema": { 951 | "default": ["*"], 952 | "type": "array", 953 | "items": { 954 | "type": "string", 955 | "enum": ["id_aid", "aid_nom", "aid_objet", "aid_operations_el", "aid_conditions", "aid_montant", "aid_benef", "aid_validation", "couverture_geo", "horodatage", "id_domaine", "handicapes", "femmes", "seniors", "jeunes", "date_fin", "status", "maj", "nb_org", "complements", "effectif", "duree_projet", "age_entreprise", "cache_indexation", "projets", "profils", "natures", "territoires", "contacts", "financeurs"] 956 | } 957 | }, 958 | "style": "form", 959 | "explode": false 960 | }, { 961 | "in": "query", 962 | "name": "sort", 963 | "description": "\n Le tri à effectuer sous forme d'une liste de clés de champs séparées par des virgules.\n\n Par défaut le tri est ascendant, si un nom de champ est préfixé par un \"-\" alors le tri sera descendant.\n\n Exemple: ma_colonne,-ma_colonne2", 964 | "required": false, 965 | "default": [], 966 | "schema": { 967 | "type": "array", 968 | "items": { 969 | "type": "string", 970 | "enum": ["id_aid", "aid_validation", "couverture_geo", "id_domaine", "handicapes", "femmes", "seniors", "jeunes", "status", "nb_org", "complements", "effectif", "duree_projet", "age_entreprise", "cache_indexation", "projets", "profils", "natures", "contacts", "financeurs"] 971 | } 972 | }, 973 | "style": "form", 974 | "explode": false 975 | }, { 976 | "in": "query", 977 | "name": "qs", 978 | "description": "\n Champ de filtre et recherche textuelle avancé. Ce paramètre permet d'effectuer des requêtes complexes sur la source de données. Vous pouvez spécifier des filtres par champs, créer des combinaisons logiques à volonté, etc.\n\n Exemple: ma_colonne:\"du texte\" AND ma_colonne2:valeur\n\n Pour plus d'information voir la documentation [ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html) correspondante.\n ", 979 | "required": false, 980 | "schema": { 981 | "type": "string" 982 | } 983 | }, { 984 | "in": "query", 985 | "name": "bbox", 986 | "description": "Un filtre pour restreindre les résultats à une zone géographique. Le format est 'gauche,bas,droite,haut' autrement dit 'lonMin,latMin,lonMax,latMax'.", 987 | "required": false, 988 | "schema": { 989 | "type": "array", 990 | "items": { 991 | "type": "number" 992 | } 993 | }, 994 | "style": "form", 995 | "explode": false 996 | }, { 997 | "in": "query", 998 | "name": "xyz", 999 | "description": "\n Un filtre pour restreindre les résultats à une zone géographique avec les paramètres standards de tuiles géographiques x,y et z.\n\n Le format est 'x,y,z'.\n ", 1000 | "required": false, 1001 | "schema": { 1002 | "type": "array", 1003 | "items": { 1004 | "type": "number" 1005 | } 1006 | }, 1007 | "style": "form", 1008 | "explode": false 1009 | }], 1010 | "responses": { 1011 | "200": { 1012 | "description": "Les informations du jeu de données agrégées par valeurs d'un champ.", 1013 | "content": { 1014 | "application/json": { 1015 | "schema": { 1016 | "type": "object" 1017 | } 1018 | } 1019 | } 1020 | } 1021 | } 1022 | } 1023 | }, 1024 | "/metric_agg": { 1025 | "get": { 1026 | "summary": "Calculer une métrique sur un ensemble de lignes.", 1027 | "operationId": "getMetricAgg", 1028 | "tags": ["Données"], 1029 | "parameters": [{ 1030 | "in": "query", 1031 | "name": "metric", 1032 | "description": "La métrique à appliquer", 1033 | "required": true, 1034 | "schema": { 1035 | "type": "string", 1036 | "enum": ["avg", "sum", "min", "max"] 1037 | } 1038 | }, { 1039 | "in": "query", 1040 | "name": "metric_field", 1041 | "description": "Le champ sur lequel effectuer la calcul de métrique", 1042 | "required": true, 1043 | "schema": { 1044 | "type": "string", 1045 | "enum": [] 1046 | } 1047 | }, { 1048 | "in": "query", 1049 | "name": "agg_size", 1050 | "description": "Le nombre de buckets pour l'agrégation (défaut 20)", 1051 | "required": false, 1052 | "schema": { 1053 | "default": 20, 1054 | "type": "integer", 1055 | "max": 10000 1056 | } 1057 | }, { 1058 | "in": "query", 1059 | "name": "size", 1060 | "description": "Le nombre de résultats à retourner (taille de la pagination). 20 par défaut.", 1061 | "required": false, 1062 | "schema": { 1063 | "default": 20, 1064 | "type": "integer", 1065 | "max": 10000 1066 | } 1067 | }, { 1068 | "in": "query", 1069 | "name": "q", 1070 | "description": "\n Champ de recherche simple. Ce paramètre peut-être utilisé pour exposer une fonctionalité de recherche textuelle riche aux utilisateurs sans risque de créer des erreurs de syntaxe.\n\n Exemple: \"open data\" | \"open source\"\n\n Pour plus d'information voir la documentation [ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html) correspondante.\n ", 1071 | "required": false, 1072 | "schema": { 1073 | "type": "string" 1074 | } 1075 | }, { 1076 | "in": "query", 1077 | "name": "select", 1078 | "description": "La liste des champs à retourner", 1079 | "required": false, 1080 | "schema": { 1081 | "default": ["*"], 1082 | "type": "array", 1083 | "items": { 1084 | "type": "string", 1085 | "enum": ["id_aid", "aid_nom", "aid_objet", "aid_operations_el", "aid_conditions", "aid_montant", "aid_benef", "aid_validation", "couverture_geo", "horodatage", "id_domaine", "handicapes", "femmes", "seniors", "jeunes", "date_fin", "status", "maj", "nb_org", "complements", "effectif", "duree_projet", "age_entreprise", "cache_indexation", "projets", "profils", "natures", "territoires", "contacts", "financeurs"] 1086 | } 1087 | }, 1088 | "style": "form", 1089 | "explode": false 1090 | }, { 1091 | "in": "query", 1092 | "name": "sort", 1093 | "description": "\n Le tri à effectuer sous forme d'une liste de clés de champs séparées par des virgules.\n\n Par défaut le tri est ascendant, si un nom de champ est préfixé par un \"-\" alors le tri sera descendant.\n\n Exemple: ma_colonne,-ma_colonne2", 1094 | "required": false, 1095 | "default": [], 1096 | "schema": { 1097 | "type": "array", 1098 | "items": { 1099 | "type": "string", 1100 | "enum": ["id_aid", "aid_validation", "couverture_geo", "id_domaine", "handicapes", "femmes", "seniors", "jeunes", "status", "nb_org", "complements", "effectif", "duree_projet", "age_entreprise", "cache_indexation", "projets", "profils", "natures", "contacts", "financeurs"] 1101 | } 1102 | }, 1103 | "style": "form", 1104 | "explode": false 1105 | }, { 1106 | "in": "query", 1107 | "name": "qs", 1108 | "description": "\n Champ de filtre et recherche textuelle avancé. Ce paramètre permet d'effectuer des requêtes complexes sur la source de données. Vous pouvez spécifier des filtres par champs, créer des combinaisons logiques à volonté, etc.\n\n Exemple: ma_colonne:\"du texte\" AND ma_colonne2:valeur\n\n Pour plus d'information voir la documentation [ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html) correspondante.\n ", 1109 | "required": false, 1110 | "schema": { 1111 | "type": "string" 1112 | } 1113 | }, { 1114 | "in": "query", 1115 | "name": "bbox", 1116 | "description": "Un filtre pour restreindre les résultats à une zone géographique. Le format est 'gauche,bas,droite,haut' autrement dit 'lonMin,latMin,lonMax,latMax'.", 1117 | "required": false, 1118 | "schema": { 1119 | "type": "array", 1120 | "items": { 1121 | "type": "number" 1122 | } 1123 | }, 1124 | "style": "form", 1125 | "explode": false 1126 | }, { 1127 | "in": "query", 1128 | "name": "xyz", 1129 | "description": "\n Un filtre pour restreindre les résultats à une zone géographique avec les paramètres standards de tuiles géographiques x,y et z.\n\n Le format est 'x,y,z'.\n ", 1130 | "required": false, 1131 | "schema": { 1132 | "type": "array", 1133 | "items": { 1134 | "type": "number" 1135 | } 1136 | }, 1137 | "style": "form", 1138 | "explode": false 1139 | }], 1140 | "responses": { 1141 | "200": { 1142 | "description": "Le résultat du calcul.", 1143 | "content": { 1144 | "application/json": { 1145 | "schema": { 1146 | "type": "object" 1147 | } 1148 | } 1149 | } 1150 | } 1151 | } 1152 | } 1153 | } 1154 | }, 1155 | "externalDocs": { 1156 | "description": "Documentation sur Github", 1157 | "url": "https://koumoul-dev.github.io/data-fair/" 1158 | } 1159 | } 1160 | -------------------------------------------------------------------------------- /test/dataset-datafair.json: -------------------------------------------------------------------------------- 1 | { 2 | "openapi": "3.0.0", 3 | "info": { 4 | "title": "API du jeu de données : aides", 5 | "version": "0.2.0", 6 | "termsOfService": "https://koumoul.com/term-of-service", 7 | "contact": { 8 | "name": "Koumoul", 9 | "url": "https://koumoul.com", 10 | "email": "support@koumoul.com" 11 | } 12 | }, 13 | "servers": [{ 14 | "url": "https://koumoul.com/s/data-fair/api/v1/datasets/aides" 15 | }], 16 | "paths": { 17 | "/": { 18 | "get": { 19 | "summary": "Récupérer les informations du jeu de données.", 20 | "operationId": "readDescription", 21 | "tags": ["Métadonnées"], 22 | "responses": { 23 | "200": { 24 | "description": "Les informations du jeu de données.", 25 | "content": { 26 | "application/json": { 27 | "schema": { 28 | "title": "Dataset", 29 | "type": "object", 30 | "additionalProperties": false, 31 | "properties": { 32 | "id": { 33 | "type": "string", 34 | "description": "Identifier of the dataset" 35 | }, 36 | "title": { 37 | "type": "string", 38 | "description": "Short title of the dataset" 39 | }, 40 | "description": { 41 | "type": "string", 42 | "description": "Detailed description of the dataset" 43 | }, 44 | "file": { 45 | "type": "object", 46 | "additionalProperties": false, 47 | "required": ["name", "size", "encoding", "mimetype"], 48 | "properties": { 49 | "name": { 50 | "type": "string", 51 | "description": "Name of the file that was used to create or update this dataset" 52 | }, 53 | "size": { 54 | "type": "number", 55 | "description": "Size of the file on disk" 56 | }, 57 | "encoding": { 58 | "type": "string", 59 | "description": "Encoding of the file" 60 | }, 61 | "mimetype": { 62 | "type": "string", 63 | "enum": ["text/csv"], 64 | "description": "Mime type of the file" 65 | }, 66 | "schema": { 67 | "type": "array", 68 | "description": "JSON schema of the fields in the file" 69 | }, 70 | "props": { 71 | "type": "object", 72 | "additionalProperties": false, 73 | "properties": { 74 | "numLines": { 75 | "type": "number", 76 | "description": "Number of lines this file has." 77 | }, 78 | "linesDelimiter": { 79 | "type": "string", 80 | "description": "New line character or characters (can be \r\n))" 81 | }, 82 | "fieldsDelimiter": { 83 | "type": "string", 84 | "description": "Fields delimiter" 85 | }, 86 | "escapeChar": { 87 | "type": "string", 88 | "description": "Character used to escape string" 89 | } 90 | } 91 | } 92 | } 93 | }, 94 | "createdBy": { 95 | "type": "string", 96 | "description": "Id of the account that created this dataset" 97 | }, 98 | "updatedBy": { 99 | "type": "string", 100 | "description": "Id of the account that last updated this dataset" 101 | }, 102 | "createdAt": { 103 | "type": "string", 104 | "description": "Creation date of this dataset", 105 | "format": "date-time" 106 | }, 107 | "updatedAt": { 108 | "type": "string", 109 | "description": "Date of the last update for this dataset", 110 | "format": "date-time" 111 | }, 112 | "owner": { 113 | "type": "object", 114 | "additionalProperties": false, 115 | "required": ["type", "id"], 116 | "properties": { 117 | "type": { 118 | "type": "string", 119 | "enum": ["user", "organization"], 120 | "description": "If the owner is a user or an organization" 121 | }, 122 | "id": { 123 | "type": "string", 124 | "description": "Identifier of the owner of this dataset" 125 | } 126 | } 127 | }, 128 | "status": { 129 | "type": "string", 130 | "enum": ["loaded", "analyzed", "schematized", "indexed", "extended", "finalized", "error"], 131 | "description": "The processing steps of a dataset." 132 | }, 133 | "schema": { 134 | "type": "array", 135 | "description": "JSON schema of the dataset" 136 | }, 137 | "count": { 138 | "type": "number", 139 | "description": "The number of indexed documents of a dataset" 140 | }, 141 | "bbox": { 142 | "type": "array", 143 | "description": "The spatial coverage of this dataset, in bounding box format.", 144 | "items": { 145 | "type": "number" 146 | } 147 | }, 148 | "license": { 149 | "type": "object", 150 | "additionalProperties": false, 151 | "required": ["title", "href"], 152 | "properties": { 153 | "title": { 154 | "type": "string", 155 | "description": "Short title for the license" 156 | }, 157 | "href": { 158 | "type": "string", 159 | "description": "The URL where the license can be read" 160 | } 161 | } 162 | }, 163 | "origin": { 164 | "type": "string", 165 | "description": "The URL where the original data can be found" 166 | }, 167 | "extensions": { 168 | "type": "array", 169 | "description": "Définition des enrichissements appliqués à ce jeu de données", 170 | "items": { 171 | "type": "object", 172 | "properties": { 173 | "active": { 174 | "type": "boolean", 175 | "description": "Toggle on and off the extension" 176 | }, 177 | "forceNext": { 178 | "type": "boolean", 179 | "description": "Set to true to force overwriting extension results on next indexing." 180 | }, 181 | "progress": { 182 | "type": "number", 183 | "description": "From 0 to 1 based on progress of the extension." 184 | }, 185 | "error": { 186 | "type": "string", 187 | "description": "An error that occured during the last time the extension was run" 188 | }, 189 | "remoteService": { 190 | "type": "string", 191 | "description": "L'identifiant du service distant utilisé pour l'enrichissement" 192 | }, 193 | "action": { 194 | "type": "string", 195 | "description": "L'identifiant de l'action du service distant à utiliser pour l'enrichissement" 196 | }, 197 | "select": { 198 | "type": "array", 199 | "description": "La liste des champs à sélectionner dans le retour du service distant. Tous les champs si absent ou vide.", 200 | "items": { 201 | "type": "string" 202 | } 203 | } 204 | } 205 | } 206 | } 207 | } 208 | } 209 | } 210 | } 211 | } 212 | } 213 | }, 214 | "patch": { 215 | "summary": "Mettre à jour les informations du jeu de données.", 216 | "operationId": "writeDescription", 217 | "tags": ["Métadonnées"], 218 | "requestBody": { 219 | "description": "Fichier à charger et informations de propriété", 220 | "required": true, 221 | "content": { 222 | "application/json": { 223 | "schema": { 224 | "title": "Dataset", 225 | "type": "object", 226 | "additionalProperties": false, 227 | "properties": { 228 | "id": { 229 | "type": "string", 230 | "description": "Identifier of the dataset" 231 | }, 232 | "title": { 233 | "type": "string", 234 | "description": "Short title of the dataset" 235 | }, 236 | "description": { 237 | "type": "string", 238 | "description": "Detailed description of the dataset" 239 | }, 240 | "file": { 241 | "type": "object", 242 | "additionalProperties": false, 243 | "required": ["name", "size", "encoding", "mimetype"], 244 | "properties": { 245 | "name": { 246 | "type": "string", 247 | "description": "Name of the file that was used to create or update this dataset" 248 | }, 249 | "size": { 250 | "type": "number", 251 | "description": "Size of the file on disk" 252 | }, 253 | "encoding": { 254 | "type": "string", 255 | "description": "Encoding of the file" 256 | }, 257 | "mimetype": { 258 | "type": "string", 259 | "enum": ["text/csv"], 260 | "description": "Mime type of the file" 261 | }, 262 | "schema": { 263 | "type": "array", 264 | "description": "JSON schema of the fields in the file" 265 | }, 266 | "props": { 267 | "type": "object", 268 | "additionalProperties": false, 269 | "properties": { 270 | "numLines": { 271 | "type": "number", 272 | "description": "Number of lines this file has." 273 | }, 274 | "linesDelimiter": { 275 | "type": "string", 276 | "description": "New line character or characters (can be \r\n))" 277 | }, 278 | "fieldsDelimiter": { 279 | "type": "string", 280 | "description": "Fields delimiter" 281 | }, 282 | "escapeChar": { 283 | "type": "string", 284 | "description": "Character used to escape string" 285 | } 286 | } 287 | } 288 | } 289 | }, 290 | "createdBy": { 291 | "type": "string", 292 | "description": "Id of the account that created this dataset" 293 | }, 294 | "updatedBy": { 295 | "type": "string", 296 | "description": "Id of the account that last updated this dataset" 297 | }, 298 | "createdAt": { 299 | "type": "string", 300 | "description": "Creation date of this dataset", 301 | "format": "date-time" 302 | }, 303 | "updatedAt": { 304 | "type": "string", 305 | "description": "Date of the last update for this dataset", 306 | "format": "date-time" 307 | }, 308 | "owner": { 309 | "type": "object", 310 | "additionalProperties": false, 311 | "required": ["type", "id"], 312 | "properties": { 313 | "type": { 314 | "type": "string", 315 | "enum": ["user", "organization"], 316 | "description": "If the owner is a user or an organization" 317 | }, 318 | "id": { 319 | "type": "string", 320 | "description": "Identifier of the owner of this dataset" 321 | } 322 | } 323 | }, 324 | "status": { 325 | "type": "string", 326 | "enum": ["loaded", "analyzed", "schematized", "indexed", "extended", "finalized", "error"], 327 | "description": "The processing steps of a dataset." 328 | }, 329 | "schema": { 330 | "type": "array", 331 | "description": "JSON schema of the dataset" 332 | }, 333 | "count": { 334 | "type": "number", 335 | "description": "The number of indexed documents of a dataset" 336 | }, 337 | "bbox": { 338 | "type": "array", 339 | "description": "The spatial coverage of this dataset, in bounding box format.", 340 | "items": { 341 | "type": "number" 342 | } 343 | }, 344 | "license": { 345 | "type": "object", 346 | "additionalProperties": false, 347 | "required": ["title", "href"], 348 | "properties": { 349 | "title": { 350 | "type": "string", 351 | "description": "Short title for the license" 352 | }, 353 | "href": { 354 | "type": "string", 355 | "description": "The URL where the license can be read" 356 | } 357 | } 358 | }, 359 | "origin": { 360 | "type": "string", 361 | "description": "The URL where the original data can be found" 362 | }, 363 | "extensions": { 364 | "type": "array", 365 | "description": "Définition des enrichissements appliqués à ce jeu de données", 366 | "items": { 367 | "type": "object", 368 | "properties": { 369 | "active": { 370 | "type": "boolean", 371 | "description": "Toggle on and off the extension" 372 | }, 373 | "forceNext": { 374 | "type": "boolean", 375 | "description": "Set to true to force overwriting extension results on next indexing." 376 | }, 377 | "progress": { 378 | "type": "number", 379 | "description": "From 0 to 1 based on progress of the extension." 380 | }, 381 | "error": { 382 | "type": "string", 383 | "description": "An error that occured during the last time the extension was run" 384 | }, 385 | "remoteService": { 386 | "type": "string", 387 | "description": "L'identifiant du service distant utilisé pour l'enrichissement" 388 | }, 389 | "action": { 390 | "type": "string", 391 | "description": "L'identifiant de l'action du service distant à utiliser pour l'enrichissement" 392 | }, 393 | "select": { 394 | "type": "array", 395 | "description": "La liste des champs à sélectionner dans le retour du service distant. Tous les champs si absent ou vide.", 396 | "items": { 397 | "type": "string" 398 | } 399 | } 400 | } 401 | } 402 | } 403 | } 404 | } 405 | } 406 | } 407 | }, 408 | "responses": { 409 | "200": { 410 | "description": "Les informations du jeu de données.", 411 | "content": { 412 | "application/json": { 413 | "schema": { 414 | "title": "Dataset", 415 | "type": "object", 416 | "additionalProperties": false, 417 | "properties": { 418 | "id": { 419 | "type": "string", 420 | "description": "Identifier of the dataset" 421 | }, 422 | "title": { 423 | "type": "string", 424 | "description": "Short title of the dataset" 425 | }, 426 | "description": { 427 | "type": "string", 428 | "description": "Detailed description of the dataset" 429 | }, 430 | "file": { 431 | "type": "object", 432 | "additionalProperties": false, 433 | "required": ["name", "size", "encoding", "mimetype"], 434 | "properties": { 435 | "name": { 436 | "type": "string", 437 | "description": "Name of the file that was used to create or update this dataset" 438 | }, 439 | "size": { 440 | "type": "number", 441 | "description": "Size of the file on disk" 442 | }, 443 | "encoding": { 444 | "type": "string", 445 | "description": "Encoding of the file" 446 | }, 447 | "mimetype": { 448 | "type": "string", 449 | "enum": ["text/csv"], 450 | "description": "Mime type of the file" 451 | }, 452 | "schema": { 453 | "type": "array", 454 | "description": "JSON schema of the fields in the file" 455 | }, 456 | "props": { 457 | "type": "object", 458 | "additionalProperties": false, 459 | "properties": { 460 | "numLines": { 461 | "type": "number", 462 | "description": "Number of lines this file has." 463 | }, 464 | "linesDelimiter": { 465 | "type": "string", 466 | "description": "New line character or characters (can be \r\n))" 467 | }, 468 | "fieldsDelimiter": { 469 | "type": "string", 470 | "description": "Fields delimiter" 471 | }, 472 | "escapeChar": { 473 | "type": "string", 474 | "description": "Character used to escape string" 475 | } 476 | } 477 | } 478 | } 479 | }, 480 | "createdBy": { 481 | "type": "string", 482 | "description": "Id of the account that created this dataset" 483 | }, 484 | "updatedBy": { 485 | "type": "string", 486 | "description": "Id of the account that last updated this dataset" 487 | }, 488 | "createdAt": { 489 | "type": "string", 490 | "description": "Creation date of this dataset", 491 | "format": "date-time" 492 | }, 493 | "updatedAt": { 494 | "type": "string", 495 | "description": "Date of the last update for this dataset", 496 | "format": "date-time" 497 | }, 498 | "owner": { 499 | "type": "object", 500 | "additionalProperties": false, 501 | "required": ["type", "id"], 502 | "properties": { 503 | "type": { 504 | "type": "string", 505 | "enum": ["user", "organization"], 506 | "description": "If the owner is a user or an organization" 507 | }, 508 | "id": { 509 | "type": "string", 510 | "description": "Identifier of the owner of this dataset" 511 | } 512 | } 513 | }, 514 | "status": { 515 | "type": "string", 516 | "enum": ["loaded", "analyzed", "schematized", "indexed", "extended", "finalized", "error"], 517 | "description": "The processing steps of a dataset." 518 | }, 519 | "schema": { 520 | "type": "array", 521 | "description": "JSON schema of the dataset" 522 | }, 523 | "count": { 524 | "type": "number", 525 | "description": "The number of indexed documents of a dataset" 526 | }, 527 | "bbox": { 528 | "type": "array", 529 | "description": "The spatial coverage of this dataset, in bounding box format.", 530 | "items": { 531 | "type": "number" 532 | } 533 | }, 534 | "license": { 535 | "type": "object", 536 | "additionalProperties": false, 537 | "required": ["title", "href"], 538 | "properties": { 539 | "title": { 540 | "type": "string", 541 | "description": "Short title for the license" 542 | }, 543 | "href": { 544 | "type": "string", 545 | "description": "The URL where the license can be read" 546 | } 547 | } 548 | }, 549 | "origin": { 550 | "type": "string", 551 | "description": "The URL where the original data can be found" 552 | }, 553 | "extensions": { 554 | "type": "array", 555 | "description": "Définition des enrichissements appliqués à ce jeu de données", 556 | "items": { 557 | "type": "object", 558 | "properties": { 559 | "active": { 560 | "type": "boolean", 561 | "description": "Toggle on and off the extension" 562 | }, 563 | "forceNext": { 564 | "type": "boolean", 565 | "description": "Set to true to force overwriting extension results on next indexing." 566 | }, 567 | "progress": { 568 | "type": "number", 569 | "description": "From 0 to 1 based on progress of the extension." 570 | }, 571 | "error": { 572 | "type": "string", 573 | "description": "An error that occured during the last time the extension was run" 574 | }, 575 | "remoteService": { 576 | "type": "string", 577 | "description": "L'identifiant du service distant utilisé pour l'enrichissement" 578 | }, 579 | "action": { 580 | "type": "string", 581 | "description": "L'identifiant de l'action du service distant à utiliser pour l'enrichissement" 582 | }, 583 | "select": { 584 | "type": "array", 585 | "description": "La liste des champs à sélectionner dans le retour du service distant. Tous les champs si absent ou vide.", 586 | "items": { 587 | "type": "string" 588 | } 589 | } 590 | } 591 | } 592 | } 593 | } 594 | } 595 | } 596 | } 597 | } 598 | } 599 | } 600 | }, 601 | "/lines": { 602 | "get": { 603 | "summary": "Requêter les lignes du jeu de données.", 604 | "operationId": "readLines", 605 | "tags": ["Données"], 606 | "parameters": [{ 607 | "in": "query", 608 | "name": "page", 609 | "description": "Le numéro de la page (indice de la pagination). Débute à 1.", 610 | "required": false, 611 | "schema": { 612 | "default": 1, 613 | "type": "integer" 614 | } 615 | }, { 616 | "in": "query", 617 | "name": "size", 618 | "description": "Le nombre de résultats à retourner (taille de la pagination). 20 par défaut.", 619 | "required": false, 620 | "schema": { 621 | "default": 20, 622 | "type": "integer", 623 | "max": 10000 624 | } 625 | }, { 626 | "in": "query", 627 | "name": "q", 628 | "description": "\n Champ de recherche simple. Ce paramètre peut-être utilisé pour exposer une fonctionalité de recherche textuelle riche aux utilisateurs sans risque de créer des erreurs de syntaxe.\n\n Exemple: \"open data\" | \"open source\"\n\n Pour plus d'information voir la documentation [ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html) correspondante.\n ", 629 | "required": false, 630 | "schema": { 631 | "type": "string" 632 | } 633 | }, { 634 | "in": "query", 635 | "name": "select", 636 | "description": "La liste des champs à retourner", 637 | "required": false, 638 | "schema": { 639 | "default": ["*"], 640 | "type": "array", 641 | "items": { 642 | "type": "string", 643 | "enum": ["id_aid", "aid_nom", "aid_objet", "aid_operations_el", "aid_conditions", "aid_montant", "aid_benef", "aid_validation", "couverture_geo", "horodatage", "id_domaine", "handicapes", "femmes", "seniors", "jeunes", "date_fin", "status", "maj", "nb_org", "complements", "effectif", "duree_projet", "age_entreprise", "cache_indexation", "projets", "profils", "natures", "territoires", "contacts", "financeurs"] 644 | } 645 | }, 646 | "style": "commaDelimited" 647 | }, { 648 | "in": "query", 649 | "name": "sort", 650 | "description": "\n Le tri à effectuer sous forme d'une liste de clés de champs séparées par des virgules.\n\n Par défaut le tri est ascendant, si un nom de champ est préfixé par un \"-\" alors le tri sera descendant.\n\n Exemple: ma_colonne,-ma_colonne2", 651 | "required": false, 652 | "default": [], 653 | "schema": { 654 | "type": "array", 655 | "items": { 656 | "type": "string", 657 | "enum": ["id_aid", "aid_validation", "couverture_geo", "id_domaine", "handicapes", "femmes", "seniors", "jeunes", "status", "nb_org", "complements", "effectif", "duree_projet", "age_entreprise", "cache_indexation", "projets", "profils", "natures", "contacts", "financeurs"] 658 | } 659 | }, 660 | "style": "commaDelimited" 661 | }, { 662 | "in": "query", 663 | "name": "qs", 664 | "description": "\n Champ de filtre et recherche textuelle avancé. Ce paramètre permet d'effectuer des requêtes complexes sur la source de données. Vous pouvez spécifier des filtres par champs, créer des combinaisons logiques à volonté, etc.\n\n Exemple: ma_colonne:\"du texte\" AND ma_colonne2:valeur\n\n Pour plus d'information voir la documentation [ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html) correspondante.\n ", 665 | "required": false, 666 | "schema": { 667 | "type": "string" 668 | } 669 | }, { 670 | "in": "query", 671 | "name": "bbox", 672 | "description": "Un filtre pour restreindre les résultats à une zone géographique. Le format est 'gauche,bas,droite,haut' autrement dit 'lonMin,latMin,lonMax,latMax'.", 673 | "required": false, 674 | "schema": { 675 | "type": "array", 676 | "items": { 677 | "type": "number" 678 | } 679 | }, 680 | "style": "commaDelimited" 681 | }, { 682 | "in": "query", 683 | "name": "xyz", 684 | "description": "\n Un filtre pour restreindre les résultats à une zone géographique avec les paramètres standards de tuiles géographiques x,y et z.\n\n Le format est 'x,y,z'.\n ", 685 | "required": false, 686 | "schema": { 687 | "type": "array", 688 | "items": { 689 | "type": "number" 690 | } 691 | }, 692 | "style": "commaDelimited" 693 | }], 694 | "responses": { 695 | "200": { 696 | "description": "Le résultat de la requête.", 697 | "content": { 698 | "application/json": { 699 | "schema": { 700 | "type": "object", 701 | "properties": { 702 | "total": { 703 | "type": "integer", 704 | "description": "Le nombre total de résultat si on ignore la pagination" 705 | }, 706 | "results": { 707 | "type": "array", 708 | "description": "Le tableau de résultats.", 709 | "items": { 710 | "type": "object", 711 | "properties": [{ 712 | "key": "id_aid", 713 | "type": "integer", 714 | "x-originalName": "id_aid", 715 | "x-cardinality": 1668 716 | }, { 717 | "key": "aid_nom", 718 | "type": "string", 719 | "x-originalName": "aid_nom" 720 | }, { 721 | "key": "aid_objet", 722 | "type": "string", 723 | "x-originalName": "aid_objet" 724 | }, { 725 | "key": "aid_operations_el", 726 | "type": "string", 727 | "x-originalName": "aid_operations_el" 728 | }, { 729 | "key": "aid_conditions", 730 | "type": "string", 731 | "x-originalName": "aid_conditions" 732 | }, { 733 | "key": "aid_montant", 734 | "type": "string", 735 | "x-originalName": "aid_montant" 736 | }, { 737 | "key": "aid_benef", 738 | "type": "string", 739 | "x-originalName": "aid_benef" 740 | }, { 741 | "key": "aid_validation", 742 | "type": "string", 743 | "x-originalName": "aid_validation", 744 | "format": "date", 745 | "x-cardinality": 198 746 | }, { 747 | "key": "couverture_geo", 748 | "type": "integer", 749 | "x-originalName": "couverture_geo", 750 | "x-cardinality": 3, 751 | "enum": [1, 2, 3] 752 | }, { 753 | "key": "horodatage", 754 | "type": "string", 755 | "x-originalName": "horodatage" 756 | }, { 757 | "key": "id_domaine", 758 | "type": "boolean", 759 | "x-originalName": "id_domaine", 760 | "x-cardinality": 2, 761 | "enum": [0, 1] 762 | }, { 763 | "key": "handicapes", 764 | "type": "boolean", 765 | "x-originalName": "handicapes", 766 | "x-cardinality": 1, 767 | "enum": [0] 768 | }, { 769 | "key": "femmes", 770 | "type": "boolean", 771 | "x-originalName": "femmes", 772 | "x-cardinality": 1, 773 | "enum": [0] 774 | }, { 775 | "key": "seniors", 776 | "type": "boolean", 777 | "x-originalName": "seniors", 778 | "x-cardinality": 1, 779 | "enum": [0] 780 | }, { 781 | "key": "jeunes", 782 | "type": "boolean", 783 | "x-originalName": "jeunes", 784 | "x-cardinality": 1, 785 | "enum": [0] 786 | }, { 787 | "key": "date_fin", 788 | "type": "string", 789 | "x-originalName": "date_fin" 790 | }, { 791 | "key": "status", 792 | "type": "boolean", 793 | "x-originalName": "status", 794 | "x-cardinality": 1, 795 | "enum": [1] 796 | }, { 797 | "key": "maj", 798 | "type": "string", 799 | "x-originalName": "maj" 800 | }, { 801 | "key": "nb_org", 802 | "type": "integer", 803 | "x-originalName": "nb_org", 804 | "x-cardinality": 19 805 | }, { 806 | "key": "complements", 807 | "type": "boolean", 808 | "x-originalName": "complements", 809 | "x-cardinality": 0, 810 | "enum": [] 811 | }, { 812 | "key": "effectif", 813 | "type": "string", 814 | "x-originalName": "effectif", 815 | "format": "uri-reference", 816 | "x-cardinality": 11 817 | }, { 818 | "key": "duree_projet", 819 | "type": "boolean", 820 | "x-originalName": "duree_projet", 821 | "x-cardinality": 1, 822 | "enum": [0] 823 | }, { 824 | "key": "age_entreprise", 825 | "type": "string", 826 | "x-originalName": "age_entreprise", 827 | "format": "uri-reference", 828 | "x-cardinality": 3, 829 | "enum": ["1,2", "1", "2"] 830 | }, { 831 | "key": "cache_indexation", 832 | "type": "boolean", 833 | "x-originalName": "cache_indexation", 834 | "x-cardinality": 0, 835 | "enum": [] 836 | }, { 837 | "key": "projets", 838 | "type": "string", 839 | "x-originalName": "projets", 840 | "format": "uri-reference", 841 | "x-cardinality": 481 842 | }, { 843 | "key": "profils", 844 | "type": "string", 845 | "x-originalName": "profils", 846 | "format": "uri-reference", 847 | "x-cardinality": 232 848 | }, { 849 | "key": "natures", 850 | "type": "string", 851 | "x-originalName": "natures", 852 | "format": "uri-reference", 853 | "x-cardinality": 45 854 | }, { 855 | "key": "territoires", 856 | "type": "string", 857 | "x-originalName": "territoires" 858 | }, { 859 | "key": "contacts", 860 | "type": "string", 861 | "x-originalName": "contacts", 862 | "format": "uri-reference", 863 | "x-cardinality": 817 864 | }, { 865 | "key": "financeurs", 866 | "type": "string", 867 | "x-originalName": "financeurs", 868 | "format": "uri-reference", 869 | "x-cardinality": 467 870 | }] 871 | } 872 | } 873 | } 874 | } 875 | } 876 | } 877 | } 878 | } 879 | } 880 | }, 881 | "/values_agg": { 882 | "get": { 883 | "summary": "Récupérer des informations agrégées en fonction des valeurs d'un champ.", 884 | "operationId": "getValuesAgg", 885 | "tags": ["Données"], 886 | "parameters": [{ 887 | "in": "query", 888 | "name": "field", 889 | "description": "Le champ en fonction des valeurs duquel grouper les lignes du jeu de donénes", 890 | "required": true, 891 | "schema": { 892 | "type": "string", 893 | "enum": ["id_aid", "aid_validation", "couverture_geo", "id_domaine", "handicapes", "femmes", "seniors", "jeunes", "status", "nb_org", "complements", "effectif", "duree_projet", "age_entreprise", "cache_indexation", "projets", "profils", "natures", "contacts", "financeurs"] 894 | } 895 | }, { 896 | "in": "query", 897 | "name": "metric", 898 | "description": "La métrique à appliquer", 899 | "required": false, 900 | "schema": { 901 | "type": "string", 902 | "enum": ["avg", "sum", "min", "max"] 903 | } 904 | }, { 905 | "in": "query", 906 | "name": "metric_field", 907 | "description": "Le champ sur lequel effectuer la calcul de métrique", 908 | "required": false, 909 | "schema": { 910 | "type": "string", 911 | "enum": [] 912 | } 913 | }, { 914 | "in": "query", 915 | "name": "agg_size", 916 | "description": "Le nombre de buckets pour l'agrégation (défaut 20)", 917 | "required": false, 918 | "schema": { 919 | "default": 20, 920 | "type": "integer", 921 | "max": 10000 922 | } 923 | }, { 924 | "in": "query", 925 | "name": "size", 926 | "description": "Le nombre de résultats à retourner (taille de la pagination). 20 par défaut.", 927 | "required": false, 928 | "schema": { 929 | "default": 20, 930 | "type": "integer", 931 | "max": 10000 932 | } 933 | }, { 934 | "in": "query", 935 | "name": "q", 936 | "description": "\n Champ de recherche simple. Ce paramètre peut-être utilisé pour exposer une fonctionalité de recherche textuelle riche aux utilisateurs sans risque de créer des erreurs de syntaxe.\n\n Exemple: \"open data\" | \"open source\"\n\n Pour plus d'information voir la documentation [ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html) correspondante.\n ", 937 | "required": false, 938 | "schema": { 939 | "type": "string" 940 | } 941 | }, { 942 | "in": "query", 943 | "name": "select", 944 | "description": "La liste des champs à retourner", 945 | "required": false, 946 | "schema": { 947 | "default": ["*"], 948 | "type": "array", 949 | "items": { 950 | "type": "string", 951 | "enum": ["id_aid", "aid_nom", "aid_objet", "aid_operations_el", "aid_conditions", "aid_montant", "aid_benef", "aid_validation", "couverture_geo", "horodatage", "id_domaine", "handicapes", "femmes", "seniors", "jeunes", "date_fin", "status", "maj", "nb_org", "complements", "effectif", "duree_projet", "age_entreprise", "cache_indexation", "projets", "profils", "natures", "territoires", "contacts", "financeurs"] 952 | } 953 | }, 954 | "style": "commaDelimited" 955 | }, { 956 | "in": "query", 957 | "name": "sort", 958 | "description": "\n Le tri à effectuer sous forme d'une liste de clés de champs séparées par des virgules.\n\n Par défaut le tri est ascendant, si un nom de champ est préfixé par un \"-\" alors le tri sera descendant.\n\n Exemple: ma_colonne,-ma_colonne2", 959 | "required": false, 960 | "default": [], 961 | "schema": { 962 | "type": "array", 963 | "items": { 964 | "type": "string", 965 | "enum": ["id_aid", "aid_validation", "couverture_geo", "id_domaine", "handicapes", "femmes", "seniors", "jeunes", "status", "nb_org", "complements", "effectif", "duree_projet", "age_entreprise", "cache_indexation", "projets", "profils", "natures", "contacts", "financeurs"] 966 | } 967 | }, 968 | "style": "commaDelimited" 969 | }, { 970 | "in": "query", 971 | "name": "qs", 972 | "description": "\n Champ de filtre et recherche textuelle avancé. Ce paramètre permet d'effectuer des requêtes complexes sur la source de données. Vous pouvez spécifier des filtres par champs, créer des combinaisons logiques à volonté, etc.\n\n Exemple: ma_colonne:\"du texte\" AND ma_colonne2:valeur\n\n Pour plus d'information voir la documentation [ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html) correspondante.\n ", 973 | "required": false, 974 | "schema": { 975 | "type": "string" 976 | } 977 | }, { 978 | "in": "query", 979 | "name": "bbox", 980 | "description": "Un filtre pour restreindre les résultats à une zone géographique. Le format est 'gauche,bas,droite,haut' autrement dit 'lonMin,latMin,lonMax,latMax'.", 981 | "required": false, 982 | "schema": { 983 | "type": "array", 984 | "items": { 985 | "type": "number" 986 | } 987 | }, 988 | "style": "commaDelimited" 989 | }, { 990 | "in": "query", 991 | "name": "xyz", 992 | "description": "\n Un filtre pour restreindre les résultats à une zone géographique avec les paramètres standards de tuiles géographiques x,y et z.\n\n Le format est 'x,y,z'.\n ", 993 | "required": false, 994 | "schema": { 995 | "type": "array", 996 | "items": { 997 | "type": "number" 998 | } 999 | }, 1000 | "style": "commaDelimited" 1001 | }], 1002 | "responses": { 1003 | "200": { 1004 | "description": "Les informations du jeu de données agrégées par valeurs d'un champ.", 1005 | "content": { 1006 | "application/json": { 1007 | "schema": { 1008 | "type": "object" 1009 | } 1010 | } 1011 | } 1012 | } 1013 | } 1014 | } 1015 | }, 1016 | "/metric_agg": { 1017 | "get": { 1018 | "summary": "Calculer une métrique sur un ensemble de lignes.", 1019 | "operationId": "getMetricAgg", 1020 | "tags": ["Données"], 1021 | "parameters": [{ 1022 | "in": "query", 1023 | "name": "metric", 1024 | "description": "La métrique à appliquer", 1025 | "required": true, 1026 | "schema": { 1027 | "type": "string", 1028 | "enum": ["avg", "sum", "min", "max"] 1029 | } 1030 | }, { 1031 | "in": "query", 1032 | "name": "metric_field", 1033 | "description": "Le champ sur lequel effectuer la calcul de métrique", 1034 | "required": true, 1035 | "schema": { 1036 | "type": "string", 1037 | "enum": [] 1038 | } 1039 | }, { 1040 | "in": "query", 1041 | "name": "agg_size", 1042 | "description": "Le nombre de buckets pour l'agrégation (défaut 20)", 1043 | "required": false, 1044 | "schema": { 1045 | "default": 20, 1046 | "type": "integer", 1047 | "max": 10000 1048 | } 1049 | }, { 1050 | "in": "query", 1051 | "name": "size", 1052 | "description": "Le nombre de résultats à retourner (taille de la pagination). 20 par défaut.", 1053 | "required": false, 1054 | "schema": { 1055 | "default": 20, 1056 | "type": "integer", 1057 | "max": 10000 1058 | } 1059 | }, { 1060 | "in": "query", 1061 | "name": "q", 1062 | "description": "\n Champ de recherche simple. Ce paramètre peut-être utilisé pour exposer une fonctionalité de recherche textuelle riche aux utilisateurs sans risque de créer des erreurs de syntaxe.\n\n Exemple: \"open data\" | \"open source\"\n\n Pour plus d'information voir la documentation [ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html) correspondante.\n ", 1063 | "required": false, 1064 | "schema": { 1065 | "type": "string" 1066 | } 1067 | }, { 1068 | "in": "query", 1069 | "name": "select", 1070 | "description": "La liste des champs à retourner", 1071 | "required": false, 1072 | "schema": { 1073 | "default": ["*"], 1074 | "type": "array", 1075 | "items": { 1076 | "type": "string", 1077 | "enum": ["id_aid", "aid_nom", "aid_objet", "aid_operations_el", "aid_conditions", "aid_montant", "aid_benef", "aid_validation", "couverture_geo", "horodatage", "id_domaine", "handicapes", "femmes", "seniors", "jeunes", "date_fin", "status", "maj", "nb_org", "complements", "effectif", "duree_projet", "age_entreprise", "cache_indexation", "projets", "profils", "natures", "territoires", "contacts", "financeurs"] 1078 | } 1079 | }, 1080 | "style": "commaDelimited" 1081 | }, { 1082 | "in": "query", 1083 | "name": "sort", 1084 | "description": "\n Le tri à effectuer sous forme d'une liste de clés de champs séparées par des virgules.\n\n Par défaut le tri est ascendant, si un nom de champ est préfixé par un \"-\" alors le tri sera descendant.\n\n Exemple: ma_colonne,-ma_colonne2", 1085 | "required": false, 1086 | "default": [], 1087 | "schema": { 1088 | "type": "array", 1089 | "items": { 1090 | "type": "string", 1091 | "enum": ["id_aid", "aid_validation", "couverture_geo", "id_domaine", "handicapes", "femmes", "seniors", "jeunes", "status", "nb_org", "complements", "effectif", "duree_projet", "age_entreprise", "cache_indexation", "projets", "profils", "natures", "contacts", "financeurs"] 1092 | } 1093 | }, 1094 | "style": "commaDelimited" 1095 | }, { 1096 | "in": "query", 1097 | "name": "qs", 1098 | "description": "\n Champ de filtre et recherche textuelle avancé. Ce paramètre permet d'effectuer des requêtes complexes sur la source de données. Vous pouvez spécifier des filtres par champs, créer des combinaisons logiques à volonté, etc.\n\n Exemple: ma_colonne:\"du texte\" AND ma_colonne2:valeur\n\n Pour plus d'information voir la documentation [ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html) correspondante.\n ", 1099 | "required": false, 1100 | "schema": { 1101 | "type": "string" 1102 | } 1103 | }, { 1104 | "in": "query", 1105 | "name": "bbox", 1106 | "description": "Un filtre pour restreindre les résultats à une zone géographique. Le format est 'gauche,bas,droite,haut' autrement dit 'lonMin,latMin,lonMax,latMax'.", 1107 | "required": false, 1108 | "schema": { 1109 | "type": "array", 1110 | "items": { 1111 | "type": "number" 1112 | } 1113 | }, 1114 | "style": "commaDelimited" 1115 | }, { 1116 | "in": "query", 1117 | "name": "xyz", 1118 | "description": "\n Un filtre pour restreindre les résultats à une zone géographique avec les paramètres standards de tuiles géographiques x,y et z.\n\n Le format est 'x,y,z'.\n ", 1119 | "required": false, 1120 | "schema": { 1121 | "type": "array", 1122 | "items": { 1123 | "type": "number" 1124 | } 1125 | }, 1126 | "style": "commaDelimited" 1127 | }], 1128 | "responses": { 1129 | "200": { 1130 | "description": "Le résultat du calcul.", 1131 | "content": { 1132 | "application/json": { 1133 | "schema": { 1134 | "type": "object" 1135 | } 1136 | } 1137 | } 1138 | } 1139 | } 1140 | } 1141 | } 1142 | }, 1143 | "externalDocs": { 1144 | "description": "Documentation sur Github", 1145 | "url": "https://koumoul-dev.github.io/data-fair/" 1146 | } 1147 | } 1148 | -------------------------------------------------------------------------------- /test/geocoder.json: -------------------------------------------------------------------------------- 1 | {"openapi":"3.0.0","info":{"x-api-id":"geocoder-koumoul","title":"Géocodage d'adresses","description":"Ce service permet de géocoder des adresses, c'est à dire de déterminer des coordonnées latitude / longitude à partir d'éléments constituant une adresse comme le nom et le numéro de rue, le code postal ou le code INSEE, le nom de la ville ou une requête textuelle contenant ces différents éléments.","termsOfService":"https://koumoul.com/term-of-service","contact":{"name":"Koumoul","url":"https://koumoul.com","email":"support@koumoul.com"},"version":"1.0.0"},"servers":[{"url":"https://koumoul.com/s/geocoder/api/v1","description":"Serveur de production"}],"externalDocs":{"description":"Documentation Koumoul","url":"https://koumoul.com/documentation"},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"x-taxman-key","in":"header"},"jwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"security":[{"apiKey":[]},{"jwt":[]}],"paths":{"/status":{"get":{"summary":"Etat de santé du service.","description":"Pour connaitre l'état de santé du service.","operationId":"getStatus","x-operationType":"http://schema.org/CheckAction","responses":{"200":{"description":"Etat de santé du service","content":{"application/json":{"schema":{"title":"Statut du service","type":"object","properties":{"status":{"type":"string","enum":["ok","error"],"description":"Si le service fonctionne correctement ou non"},"message":{"type":"string","description":"Description de l'état du service en une phrase"},"details":{"type":"array","description":"Détail du statut des services utilisés","items":{"type":"object","properties":{"name":{"type":"string","description":"Identifiant du service"},"status":{"type":"string","enum":["ok","error"],"description":"Si le service fonctionne correctement ou non"},"details":{"type":"object","description":"Détail du statut du service utilisé"}}}}}},"example":{"value":{"status":"ok","message":"Service is ok","details":[{"name":"elasticsearch","status":"ok","details":{"number_of_pending_tasks":0,"number_of_in_flight_fetch":0,"task_max_waiting_in_queue_millis":0}},{"name":"redis","status":"ok","details":{"uptime_in_seconds":"1118273","uptime_in_days":"12","connected_clients":"3","blocked_clients":"0"}}]}}}}}}}},"/coord":{"get":{"summary":"Géocoder une adresse en récupérant la meilleure coordonnée possible","operationId":"getCoord","x-operationType":"http://schema.org/SearchAction","parameters":[{"in":"query","name":"select","description":"La liste des champs à retourner","required":false,"schema":{"default":["*"],"type":"array","items":{"type":"string","enum":["lat","lon","type","label","name","city","housenumber","postcode","citycode","context"]}},"style":"form","explode":false},{"name":"q","description":"Cette requête peut contenir n'importe quels éléments d'une adresse","in":"query","required":false,"schema":{"type":"string"},"x-refersTo":"http://schema.org/address"},{"name":"name","in":"query","required":false,"schema":{"type":"string"},"x-refersTo":"http://schema.org/streetAddress"},{"name":"city","in":"query","required":false,"schema":{"type":"string"},"x-refersTo":"http://schema.org/City"},{"name":"housenumber","description":"Peut contenir des mots comme bis ou ter","in":"query","required":false,"schema":{"type":"string"},"x-refersTo":"http://www.ontotext.com/proton/protonext#StreetNumber"},{"name":"postcode","description":"sur 5 caractères","in":"query","required":false,"schema":{"type":"string"},"x-refersTo":"http://schema.org/postalCode"},{"name":"citycode","description":"sur 5 caractères","in":"query","required":false,"schema":{"type":"string"},"x-refersTo":"http://rdf.insee.fr/def/geo#codeCommune"},{"name":"context","description":"Région et département ou autre information contextuelle de l'adresse","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Coordonnées de l'adresse","content":{"application/json":{"schema":{"title":"Réponse","x-refersTo":"http://schema.org/GeoCoordinates","type":"object","properties":{"lat":{"x-refersTo":"http://schema.org/latitude","title":"Latitude","type":"number"},"lon":{"x-refersTo":"http://schema.org/longitude","title":"Longitude","type":"number"},"type":{"title":"Type d'élément retourné","type":"string","enum":["municipality","street","locality"]},"label":{"type":"string","title":"Libellé de localisation","description":"Libellé de la localisation construit à partir des champs individuels et en fonction du type"},"name":{"x-refersTo":"http://schema.org/streetAddress","type":"string","title":"Nom de la voie ou du lieu-dit"},"city":{"x-refersTo":"http://schema.org/City","type":"string","title":"Nom de la commune"},"housenumber":{"x-refersTo":"http://www.ontotext.com/proton/protonext#StreetNumber","type":"string","title":"Numéro dans la voie","description":"Peut contenir des mots comme bis ou ter"},"postcode":{"x-refersTo":"http://schema.org/postalCode","type":"string","title":"Code postal","description":"sur 5 caractères"},"citycode":{"x-refersTo":"http://rdf.insee.fr/def/geo#codeCommune","type":"string","title":"Code INSEE de la commune","description":"sur 5 caractères"},"context":{"type":"string","title":"Contexte","description":"Région et département ou autre information contextuelle de l'adresse"}}},"examples":{}}}},"404":{"description":"Aucune localisation n'a été trouvée pour les paramètres donnés en entrée."}}}},"/_search":{"get":{"summary":"Géocoder une adresse en retournant une liste de localisations candidates","operationId":"searchCoord","x-operationType":"http://schema.org/SearchAction","parameters":[{"in":"query","name":"select","description":"La liste des champs à retourner","required":false,"schema":{"default":["*"],"type":"array","items":{"type":"string","enum":["lat","lon","type","label","name","city","housenumber","postcode","citycode","context"]}},"style":"form","explode":false},{"name":"q","description":"Cette requête peut contenir n'importe quels éléments d'une adresse","in":"query","required":false,"schema":{"type":"string"},"x-refersTo":"http://schema.org/address"},{"name":"name","in":"query","required":false,"schema":{"type":"string"},"x-refersTo":"http://schema.org/streetAddress"},{"name":"city","in":"query","required":false,"schema":{"type":"string"},"x-refersTo":"http://schema.org/City"},{"name":"housenumber","description":"Peut contenir des mots comme bis ou ter","in":"query","required":false,"schema":{"type":"string"},"x-refersTo":"http://www.ontotext.com/proton/protonext#StreetNumber"},{"name":"postcode","description":"sur 5 caractères","in":"query","required":false,"schema":{"type":"string"},"x-refersTo":"http://schema.org/postalCode"},{"name":"citycode","description":"sur 5 caractères","in":"query","required":false,"schema":{"type":"string"},"x-refersTo":"http://rdf.insee.fr/def/geo#codeCommune"},{"name":"context","description":"Région et département ou autre information contextuelle de l'adresse","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Coordonnées de l'adresse","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","description":"Nombre total de résultats"},"results":{"type":"array","items":{"title":"Réponse","x-refersTo":"http://schema.org/GeoCoordinates","type":"object","properties":{"lat":{"x-refersTo":"http://schema.org/latitude","title":"Latitude","type":"number"},"lon":{"x-refersTo":"http://schema.org/longitude","title":"Longitude","type":"number"},"type":{"title":"Type d'élément retourné","type":"string","enum":["municipality","street","locality"]},"label":{"type":"string","title":"Libellé de localisation","description":"Libellé de la localisation construit à partir des champs individuels et en fonction du type"},"name":{"x-refersTo":"http://schema.org/streetAddress","type":"string","title":"Nom de la voie ou du lieu-dit"},"city":{"x-refersTo":"http://schema.org/City","type":"string","title":"Nom de la commune"},"housenumber":{"x-refersTo":"http://www.ontotext.com/proton/protonext#StreetNumber","type":"string","title":"Numéro dans la voie","description":"Peut contenir des mots comme bis ou ter"},"postcode":{"x-refersTo":"http://schema.org/postalCode","type":"string","title":"Code postal","description":"sur 5 caractères"},"citycode":{"x-refersTo":"http://rdf.insee.fr/def/geo#codeCommune","type":"string","title":"Code INSEE de la commune","description":"sur 5 caractères"},"context":{"type":"string","title":"Contexte","description":"Région et département ou autre information contextuelle de l'adresse"}}}}}}}}}}}},"/coords":{"post":{"summary":"Géocoder un ensemble d'adresses","operationId":"postCoords","x-operationType":"http://schema.org/SearchAction","requestBody":{"description":"Ensemble d'adresses à géocoder","required":true,"content":{"application/json":{"schema":{"type":"array","x-collectionOn":"http://schema.org/PostalAddress","items":{"title":"Requête pour une adresse","type":"object","properties":{"key":{"x-refersTo":"http://schema.org/identifier","type":"string","description":"Identifiant de la ligne dans la requête en masse"},"q":{"x-refersTo":"http://schema.org/address","type":"string","title":"Requête textuelle","description":"Cette requête peut contenir n'importe quels éléments d'une adresse"},"name":{"x-refersTo":"http://schema.org/streetAddress","type":"string","title":"Nom de la voie ou du lieu-dit"},"city":{"x-refersTo":"http://schema.org/City","type":"string","title":"Nom de la commune"},"housenumber":{"x-refersTo":"http://www.ontotext.com/proton/protonext#StreetNumber","type":"string","title":"Numéro dans la voie","description":"Peut contenir des mots comme bis ou ter"},"postcode":{"x-refersTo":"http://schema.org/postalCode","type":"string","title":"Code postal","description":"sur 5 caractères"},"citycode":{"x-refersTo":"http://rdf.insee.fr/def/geo#codeCommune","type":"string","title":"Code INSEE de la commune","description":"sur 5 caractères"},"context":{"type":"string","title":"Contexte","description":"Région et département ou autre information contextuelle de l'adresse"}}}}},"application/x-ndjson":{"schema":{"x-collectionOn":"http://schema.org/PostalAddress","title":"Requête pour une adresse","type":"object","properties":{"key":{"x-refersTo":"http://schema.org/identifier","type":"string","description":"Identifiant de la ligne dans la requête en masse"},"q":{"x-refersTo":"http://schema.org/address","type":"string","title":"Requête textuelle","description":"Cette requête peut contenir n'importe quels éléments d'une adresse"},"name":{"x-refersTo":"http://schema.org/streetAddress","type":"string","title":"Nom de la voie ou du lieu-dit"},"city":{"x-refersTo":"http://schema.org/City","type":"string","title":"Nom de la commune"},"housenumber":{"x-refersTo":"http://www.ontotext.com/proton/protonext#StreetNumber","type":"string","title":"Numéro dans la voie","description":"Peut contenir des mots comme bis ou ter"},"postcode":{"x-refersTo":"http://schema.org/postalCode","type":"string","title":"Code postal","description":"sur 5 caractères"},"citycode":{"x-refersTo":"http://rdf.insee.fr/def/geo#codeCommune","type":"string","title":"Code INSEE de la commune","description":"sur 5 caractères"},"context":{"type":"string","title":"Contexte","description":"Région et département ou autre information contextuelle de l'adresse"}}}},"text/csv":{}}},"responses":{"200":{"description":"Géocodage des adresses","content":{"application/json":{"schema":{"type":"array","x-collectionOn":"http://schema.org/GeoCoordinates","items":{"title":"Réponse","x-refersTo":"http://schema.org/GeoCoordinates","type":"object","properties":{"lat":{"x-refersTo":"http://schema.org/latitude","title":"Latitude","type":"number"},"lon":{"x-refersTo":"http://schema.org/longitude","title":"Longitude","type":"number"},"type":{"title":"Type d'élément retourné","type":"string","enum":["municipality","street","locality"]},"label":{"type":"string","title":"Libellé de localisation","description":"Libellé de la localisation construit à partir des champs individuels et en fonction du type"},"name":{"x-refersTo":"http://schema.org/streetAddress","type":"string","title":"Nom de la voie ou du lieu-dit"},"city":{"x-refersTo":"http://schema.org/City","type":"string","title":"Nom de la commune"},"housenumber":{"x-refersTo":"http://www.ontotext.com/proton/protonext#StreetNumber","type":"string","title":"Numéro dans la voie","description":"Peut contenir des mots comme bis ou ter"},"postcode":{"x-refersTo":"http://schema.org/postalCode","type":"string","title":"Code postal","description":"sur 5 caractères"},"citycode":{"x-refersTo":"http://rdf.insee.fr/def/geo#codeCommune","type":"string","title":"Code INSEE de la commune","description":"sur 5 caractères"},"context":{"type":"string","title":"Contexte","description":"Région et département ou autre information contextuelle de l'adresse"},"key":{"x-refersTo":"http://schema.org/identifier","type":"string","description":"Identifiant de la ligne dans la requête en masse"},"error":{"description":"Si il y a eu une erreur dans le traitement d'une ligne","type":"string"},"status":{"description":"Si le traitement a été bon ou pas","type":"string"}}}}},"application/x-ndjson":{"schema":{"x-collectionOn":"http://schema.org/GeoCoordinates","title":"Réponse","x-refersTo":"http://schema.org/GeoCoordinates","type":"object","properties":{"lat":{"x-refersTo":"http://schema.org/latitude","title":"Latitude","type":"number"},"lon":{"x-refersTo":"http://schema.org/longitude","title":"Longitude","type":"number"},"type":{"title":"Type d'élément retourné","type":"string","enum":["municipality","street","locality"]},"label":{"type":"string","title":"Libellé de localisation","description":"Libellé de la localisation construit à partir des champs individuels et en fonction du type"},"name":{"x-refersTo":"http://schema.org/streetAddress","type":"string","title":"Nom de la voie ou du lieu-dit"},"city":{"x-refersTo":"http://schema.org/City","type":"string","title":"Nom de la commune"},"housenumber":{"x-refersTo":"http://www.ontotext.com/proton/protonext#StreetNumber","type":"string","title":"Numéro dans la voie","description":"Peut contenir des mots comme bis ou ter"},"postcode":{"x-refersTo":"http://schema.org/postalCode","type":"string","title":"Code postal","description":"sur 5 caractères"},"citycode":{"x-refersTo":"http://rdf.insee.fr/def/geo#codeCommune","type":"string","title":"Code INSEE de la commune","description":"sur 5 caractères"},"context":{"type":"string","title":"Contexte","description":"Région et département ou autre information contextuelle de l'adresse"},"key":{"x-refersTo":"http://schema.org/identifier","type":"string","description":"Identifiant de la ligne dans la requête en masse"},"error":{"description":"Si il y a eu une erreur dans le traitement d'une ligne","type":"string"},"status":{"description":"Si le traitement a été bon ou pas","type":"string"}}}},"text/csv":{}}}}}},"/geocode":{"post":{"summary":"Géocoder un ensemble de documents","operationId":"postGeocode","deprecated":true,"parameters":[{"in":"query","name":"select","description":"La liste des champs à retourner","required":false,"schema":{"default":["*"],"type":"array","items":{"type":"string","enum":["lat","lon","type","label","name","city","housenumber","postcode","citycode","context"]}},"style":"form","explode":false},{"name":"q","description":"Cette requête peut contenir n'importe quels éléments d'une adresse","in":"query","required":false,"schema":{"type":"string"},"x-refersTo":"http://schema.org/address"},{"name":"name","in":"query","required":false,"schema":{"type":"string"},"x-refersTo":"http://schema.org/streetAddress"},{"name":"city","in":"query","required":false,"schema":{"type":"string"},"x-refersTo":"http://schema.org/City"},{"name":"housenumber","description":"Peut contenir des mots comme bis ou ter","in":"query","required":false,"schema":{"type":"string"},"x-refersTo":"http://www.ontotext.com/proton/protonext#StreetNumber"},{"name":"postcode","description":"sur 5 caractères","in":"query","required":false,"schema":{"type":"string"},"x-refersTo":"http://schema.org/postalCode"},{"name":"citycode","description":"sur 5 caractères","in":"query","required":false,"schema":{"type":"string"},"x-refersTo":"http://rdf.insee.fr/def/geo#codeCommune"},{"name":"context","description":"Région et département ou autre information contextuelle de l'adresse","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"description":"Ensemble de documents à géocoder","required":true,"content":{"application/json":{},"text/csv":{}}},"responses":{"200":{"description":"Documents complétés par les champs lat, lon et matchLevel","content":{"application/json":{},"text/csv":{}}}}}}}} -------------------------------------------------------------------------------- /test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vue OpenApi by Koumoul 8 | 9 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /test/multipart.json: -------------------------------------------------------------------------------- 1 | { 2 | "openapi": "3.0.0", 3 | "info": { 4 | "title": "Upload de fichiers et autres contenus multipart/form-data", 5 | "version": "0.2.0", 6 | "contact": { 7 | "name": "Koumoul", 8 | "url": "https://koumoul.com", 9 | "email": "support@koumoul.com" 10 | } 11 | }, 12 | "servers": [{ 13 | "url": "http://localhost:5600/api/v1/datasets" 14 | }], 15 | "components": { 16 | "securitySchemes": { 17 | "apiKey": { 18 | "type": "apiKey", 19 | "in": "header", 20 | "name": "x-apiKey" 21 | }, 22 | "sdCookie": { 23 | "type": "apiKey", 24 | "in": "cookie", 25 | "name": "id_token" 26 | } 27 | } 28 | }, 29 | "security": [{"apiKey": []}, {"sdCookie": []}], 30 | "paths": { 31 | "/": { 32 | "get": { 33 | "summary": "Lister les jeux de données.", 34 | "operationId": "listDatasets", 35 | "tags": ["Jeux de données"], 36 | "parameters": [{ 37 | "name": "filter", 38 | "in": "query" 39 | }], 40 | "responses": { 41 | "200": { 42 | "content": { 43 | "application/json": { 44 | "schema": { 45 | "type": "object" 46 | } 47 | } 48 | } 49 | } 50 | } 51 | }, 52 | "post": { 53 | "summary": "Charger un jeu de données", 54 | "operationId": "postDataset", 55 | "tags": ["Jeux de données"], 56 | "requestBody": { 57 | "description": "Fichier à charger et métadonnées", 58 | "required": true, 59 | "content": { 60 | "multipart/form-data": { 61 | "schema": { 62 | "type": "object", 63 | "title": "Dataset", 64 | "properties": { 65 | "id": { 66 | "type": "string", 67 | "description": "Identifier of the dataset" 68 | }, 69 | "title": { 70 | "type": "string", 71 | "description": "Short title of the dataset" 72 | }, 73 | "description": { 74 | "type": "string", 75 | "description": "Detailed description of the dataset" 76 | }, 77 | "schema": { 78 | "type": "array", 79 | "description": "JSON schema of the dataset", 80 | "items": { 81 | "type": "object" 82 | } 83 | }, 84 | "file": { 85 | "type": "string", 86 | "format": "binary" 87 | } 88 | } 89 | } 90 | } 91 | } 92 | }, 93 | "responses": { 94 | "200": { 95 | "description": "Les informations du jeu de données.", 96 | "content": { 97 | "application/json": { 98 | "schema": { 99 | "title": "Dataset", 100 | "type": "object" 101 | } 102 | } 103 | } 104 | } 105 | } 106 | } 107 | } 108 | }, 109 | "externalDocs": { 110 | "description": "Documentation sur Github", 111 | "url": "https://koumoul-dev.github.io/data-fair/" 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /test/multiple-example-koumoul.json: -------------------------------------------------------------------------------- 1 | { 2 | "openapi": "3.0.0", 3 | "servers": [ 4 | { 5 | "url": "http://example.com/v1", 6 | "description": "Production server version 1" 7 | }, 8 | { 9 | "url": "http://staging-api.example.com", 10 | "description": "Staging server" 11 | } 12 | ], 13 | "info": { 14 | "description": "This is an API documentation of example.\n", 15 | "version": "0.1.0", 16 | "title": "Example", 17 | "termsOfService": "http://www.example.com/terms/", 18 | "contact": { 19 | "email": "developer@example.com" 20 | }, 21 | "license": { 22 | "name": "Proprietary license", 23 | "url": "http://www.example.com/license/" 24 | } 25 | }, 26 | "tags": [ 27 | { 28 | "name": "agent", 29 | "description": "Access to example" 30 | } 31 | ], 32 | "paths": { 33 | "/agents/{agentId}": { 34 | "put": { 35 | "tags": [ 36 | "agent" 37 | ], 38 | "summary": "Edit agent", 39 | "operationId": "editAgent", 40 | "parameters": [ 41 | { 42 | "in": "path", 43 | "name": "agentId", 44 | "schema": { 45 | "type": "integer" 46 | }, 47 | "examples": { 48 | "agentOne": { 49 | "value": 1 50 | }, 51 | "agentTwo": { 52 | "value": 2 53 | } 54 | }, 55 | "required": true, 56 | "description": "Numeric ID of the paper agent to edit" 57 | } 58 | ], 59 | "requestBody": { 60 | "required": true, 61 | "content": { 62 | "application/json": { 63 | "schema": { 64 | "type": "object", 65 | "properties": { 66 | "code": { 67 | "type": "string" 68 | }, 69 | "name": { 70 | "type": "string" 71 | } 72 | } 73 | }, 74 | "examples": { 75 | "editAgentOne": { 76 | "value": { 77 | "code": "AE1", 78 | "name": "Andrew" 79 | } 80 | }, 81 | "editAgentTwo": { 82 | "value": { 83 | "code": "AE2", 84 | "name": "Yono" 85 | } 86 | } 87 | } 88 | } 89 | } 90 | }, 91 | "responses": { 92 | "200": { 93 | "description": "Success get list of area", 94 | "content": { 95 | "application/json": { 96 | "schema": { 97 | "type": "object", 98 | "properties": { 99 | "code": { 100 | "type": "integer", 101 | "format": "int64" 102 | }, 103 | "payload": { 104 | "type": "array", 105 | "items": { 106 | "type": "object", 107 | "properties": { 108 | "id": { 109 | "type": "integer", 110 | "format": "int64", 111 | "readOnly": true 112 | }, 113 | "code": { 114 | "type": "string" 115 | }, 116 | "name": { 117 | "type": "string" 118 | } 119 | } 120 | } 121 | } 122 | } 123 | }, 124 | "examples": { 125 | "successEditAgentOne": { 126 | "value": { 127 | "code": 200, 128 | "payload": { 129 | "id": 1, 130 | "code": "AE1", 131 | "name": "Andrew" 132 | } 133 | } 134 | }, 135 | "successEditAgentTwo": { 136 | "value": { 137 | "code": 200, 138 | "payload": { 139 | "id": 1, 140 | "code": "AE2", 141 | "name": "Yono" 142 | } 143 | } 144 | } 145 | } 146 | } 147 | } 148 | } 149 | } 150 | } 151 | } 152 | } 153 | } -------------------------------------------------------------------------------- /test/official-examples/api-with-examples.json: -------------------------------------------------------------------------------- 1 | { 2 | "openapi": "3.0.0", 3 | "info": { 4 | "title": "Simple API overview", 5 | "version": "v2" 6 | }, 7 | "paths": { 8 | "/": { 9 | "get": { 10 | "operationId": "listVersionsv2", 11 | "summary": "List API versions", 12 | "responses": { 13 | "200": { 14 | "description": "200 response", 15 | "content": { 16 | "application/json": { 17 | "examples": { 18 | "foo": { 19 | "value": { 20 | "versions": [{ 21 | "status": "CURRENT", 22 | "updated": "2011-01-21T11:33:21Z", 23 | "id": "v2.0", 24 | "links": [{ 25 | "href": "http://127.0.0.1:8774/v2/", 26 | "rel": "self" 27 | }] 28 | }, { 29 | "status": "EXPERIMENTAL", 30 | "updated": "2013-07-23T11:33:21Z", 31 | "id": "v3.0", 32 | "links": [{ 33 | "href": "http://127.0.0.1:8774/v3/", 34 | "rel": "self" 35 | }] 36 | }] 37 | } 38 | } 39 | } 40 | } 41 | } 42 | }, 43 | "300": { 44 | "description": "300 response", 45 | "content": { 46 | "application/json": { 47 | "examples": { 48 | "foo": { 49 | "value": { 50 | "versions": [{ 51 | "status": "CURRENT", 52 | "updated": "2011-01-21T11:33:21Z", 53 | "id": "v2.0", 54 | "links": [{ 55 | "href": "http://127.0.0.1:8774/v2/", 56 | "rel": "self" 57 | }] 58 | }, { 59 | "status": "EXPERIMENTAL", 60 | "updated": "2013-07-23T11:33:21Z", 61 | "id": "v3.0", 62 | "links": [{ 63 | "href": "http://127.0.0.1:8774/v3/", 64 | "rel": "self" 65 | }] 66 | }] 67 | } 68 | } 69 | } 70 | } 71 | } 72 | } 73 | } 74 | } 75 | }, 76 | "/v2": { 77 | "get": { 78 | "operationId": "getVersionDetailsv2", 79 | "summary": "Show API version details", 80 | "responses": { 81 | "200": { 82 | "description": "200 response", 83 | "content": { 84 | "application/json": { 85 | "examples": { 86 | "foo": { 87 | "value": { 88 | "version": { 89 | "status": "CURRENT", 90 | "updated": "2011-01-21T11:33:21Z", 91 | "media-types": [{ 92 | "base": "application/xml", 93 | "type": "application/vnd.openstack.compute+xml;version=2" 94 | }, { 95 | "base": "application/json", 96 | "type": "application/vnd.openstack.compute+json;version=2" 97 | }], 98 | "id": "v2.0", 99 | "links": [{ 100 | "href": "http://127.0.0.1:8774/v2/", 101 | "rel": "self" 102 | }, { 103 | "href": "http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf", 104 | "type": "application/pdf", 105 | "rel": "describedby" 106 | }, { 107 | "href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl", 108 | "type": "application/vnd.sun.wadl+xml", 109 | "rel": "describedby" 110 | }, { 111 | "href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl", 112 | "type": "application/vnd.sun.wadl+xml", 113 | "rel": "describedby" 114 | }] 115 | } 116 | } 117 | } 118 | } 119 | } 120 | } 121 | }, 122 | "203": { 123 | "description": "203 response", 124 | "content": { 125 | "application/json": { 126 | "examples": { 127 | "foo": { 128 | "value": { 129 | "version": { 130 | "status": "CURRENT", 131 | "updated": "2011-01-21T11:33:21Z", 132 | "media-types": [{ 133 | "base": "application/xml", 134 | "type": "application/vnd.openstack.compute+xml;version=2" 135 | }, { 136 | "base": "application/json", 137 | "type": "application/vnd.openstack.compute+json;version=2" 138 | }], 139 | "id": "v2.0", 140 | "links": [{ 141 | "href": "http://23.253.228.211:8774/v2/", 142 | "rel": "self" 143 | }, { 144 | "href": "http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf", 145 | "type": "application/pdf", 146 | "rel": "describedby" 147 | }, { 148 | "href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl", 149 | "type": "application/vnd.sun.wadl+xml", 150 | "rel": "describedby" 151 | }] 152 | } 153 | } 154 | } 155 | } 156 | } 157 | } 158 | } 159 | } 160 | } 161 | } 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /test/petstore.json: -------------------------------------------------------------------------------- 1 | { 2 | "openapi": "3.0.0-RC0", 3 | "servers": [{ 4 | "url": "http://petstore.swagger.io/v2" 5 | }], 6 | "info": { 7 | "description": "This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters", 8 | "version": "1.0.0", 9 | "title": "Swagger Petstore", 10 | "termsOfService": "http://swagger.io/terms/", 11 | "contact": { 12 | "url": "http://swagger.io", 13 | "name": "Your pals at Swagger", 14 | "email": "apiteam@swagger.io" 15 | }, 16 | "license": { 17 | "name": "Apache 2.0", 18 | "url": "http://www.apache.org/licenses/LICENSE-2.0.html" 19 | } 20 | }, 21 | "tags": [{ 22 | "name": "user", 23 | "description": "Operations about user" 24 | }, { 25 | "name": "store", 26 | "description": "Access to Petstore orders", 27 | "externalDocs": { 28 | "description": "Find out more", 29 | "url": "http://swagger.io" 30 | } 31 | }, { 32 | "name": "pet", 33 | "description": "Everything about your Pets", 34 | "externalDocs": { 35 | "description": "Find out more", 36 | "url": "http://swagger.io" 37 | } 38 | }], 39 | "paths": { 40 | "/pet": { 41 | "post": { 42 | "tags": [ 43 | "pet" 44 | ], 45 | "summary": "Add a new pet to the store", 46 | "description": "", 47 | "operationId": "addPet", 48 | "parameters": [], 49 | "responses": { 50 | "405": { 51 | "description": "Invalid input" 52 | } 53 | }, 54 | "security": [{ 55 | "petstore_auth": [ 56 | "write:pets", 57 | "read:pets" 58 | ] 59 | }], 60 | "requestBody": { 61 | "$ref": "#/components/requestBodies/requestBody1" 62 | } 63 | }, 64 | "put": { 65 | "tags": [ 66 | "pet" 67 | ], 68 | "summary": "Update an existing pet", 69 | "description": "", 70 | "operationId": "updatePet", 71 | "parameters": [], 72 | "responses": { 73 | "400": { 74 | "description": "Invalid ID supplied" 75 | }, 76 | "404": { 77 | "description": "Pet not found" 78 | }, 79 | "405": { 80 | "description": "Validation exception" 81 | } 82 | }, 83 | "security": [{ 84 | "petstore_auth": [ 85 | "write:pets", 86 | "read:pets" 87 | ] 88 | }], 89 | "requestBody": { 90 | "$ref": "#/components/requestBodies/requestBody1" 91 | } 92 | } 93 | }, 94 | "/pet/findByStatus": { 95 | "get": { 96 | "tags": [ 97 | "pet" 98 | ], 99 | "summary": "Finds Pets by status", 100 | "description": "Multiple status values can be provided with comma seperated strings", 101 | "operationId": "findPetsByStatus", 102 | "parameters": [{ 103 | "in": "query", 104 | "name": "status", 105 | "description": "Status values that need to be considered for filter", 106 | "required": false, 107 | "schema": { 108 | "type": "array", 109 | "items": { 110 | "type": "string" 111 | } 112 | } 113 | }], 114 | "responses": { 115 | "200": { 116 | "description": "successful operation", 117 | "content": { 118 | "application/json": { 119 | "schema": { 120 | "type": "array", 121 | "items": { 122 | "$ref": "#/components/schemas/Pet" 123 | } 124 | } 125 | }, 126 | "application/xml": { 127 | "schema": { 128 | "type": "array", 129 | "items": { 130 | "$ref": "#/components/schemas/Pet" 131 | } 132 | } 133 | } 134 | } 135 | }, 136 | "400": { 137 | "description": "Invalid status value" 138 | } 139 | }, 140 | "security": [{ 141 | "petstore_auth": [ 142 | "write:pets", 143 | "read:pets" 144 | ] 145 | }] 146 | } 147 | }, 148 | "/pet/findByTags": { 149 | "get": { 150 | "tags": [ 151 | "pet" 152 | ], 153 | "summary": "Finds Pets by tags", 154 | "description": "Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.", 155 | "operationId": "findPetsByTags", 156 | "parameters": [{ 157 | "in": "query", 158 | "name": "tags", 159 | "description": "Tags to filter by", 160 | "required": false, 161 | "schema": { 162 | "type": "array", 163 | "items": { 164 | "type": "string" 165 | } 166 | } 167 | }], 168 | "responses": { 169 | "200": { 170 | "description": "successful operation", 171 | "content": { 172 | "application/json": { 173 | "schema": { 174 | "type": "array", 175 | "items": { 176 | "$ref": "#/components/schemas/Pet" 177 | }, 178 | "example": { 179 | "name": "rex", 180 | "photoUrls": [] 181 | } 182 | } 183 | }, 184 | "application/xml": { 185 | "schema": { 186 | "type": "array", 187 | "items": { 188 | "$ref": "#/components/schemas/Pet" 189 | } 190 | } 191 | } 192 | } 193 | }, 194 | "400": { 195 | "description": "Invalid tag value" 196 | } 197 | }, 198 | "security": [{ 199 | "petstore_auth": [ 200 | "write:pets", 201 | "read:pets" 202 | ] 203 | }] 204 | } 205 | }, 206 | "/pet/{petId}": { 207 | "parameters": [{ 208 | "in": "path", 209 | "name": "petId", 210 | "description": "ID of pet", 211 | "required": true, 212 | "schema": { 213 | "type": "integer", 214 | "format": "int64" 215 | } 216 | }], 217 | "get": { 218 | "tags": [ 219 | "pet" 220 | ], 221 | "summary": "Find pet by ID", 222 | "description": "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions", 223 | "operationId": "getPetById", 224 | "responses": { 225 | "200": { 226 | "description": "successful operation", 227 | "content": { 228 | "application/json": { 229 | "schema": { 230 | "$ref": "#/components/schemas/Pet" 231 | } 232 | }, 233 | "application/xml": { 234 | "schema": { 235 | "$ref": "#/components/schemas/Pet" 236 | } 237 | } 238 | } 239 | }, 240 | "400": { 241 | "description": "Invalid ID supplied" 242 | }, 243 | "404": { 244 | "description": "Pet not found" 245 | } 246 | }, 247 | "security": [{ 248 | "api_key": [] 249 | }, { 250 | "petstore_auth": [ 251 | "write:pets", 252 | "read:pets" 253 | ] 254 | }] 255 | }, 256 | "post": { 257 | "tags": [ 258 | "pet" 259 | ], 260 | "summary": "Updates a pet in the store with form data", 261 | "description": "", 262 | "operationId": "updatePetWithForm", 263 | "responses": { 264 | "405": { 265 | "description": "Invalid input" 266 | } 267 | }, 268 | "security": [{ 269 | "petstore_auth": [ 270 | "write:pets", 271 | "read:pets" 272 | ] 273 | }], 274 | "requestBody": { 275 | "content": { 276 | "application/x-www-form-urlencoded": { 277 | "schema": { 278 | "type": "object", 279 | "properties": { 280 | "name": { 281 | "description": "Updated name of the pet", 282 | "type": "string", 283 | "required": true 284 | }, 285 | "status": { 286 | "description": "Updated status of the pet", 287 | "type": "string", 288 | "required": true 289 | } 290 | } 291 | } 292 | } 293 | } 294 | } 295 | }, 296 | "delete": { 297 | "tags": [ 298 | "pet" 299 | ], 300 | "summary": "Deletes a pet", 301 | "description": "", 302 | "operationId": "deletePet", 303 | "parameters": [{ 304 | "in": "header", 305 | "name": "api_key", 306 | "description": "", 307 | "required": true, 308 | "schema": { 309 | "type": "string" 310 | } 311 | }], 312 | "responses": { 313 | "400": { 314 | "description": "Invalid pet value" 315 | } 316 | }, 317 | "security": [{ 318 | "petstore_auth": [ 319 | "write:pets", 320 | "read:pets" 321 | ] 322 | }] 323 | } 324 | }, 325 | "/store/order": { 326 | "post": { 327 | "tags": [ 328 | "store" 329 | ], 330 | "summary": "Place an order for a pet", 331 | "description": "", 332 | "operationId": "placeOrder", 333 | "parameters": [], 334 | "responses": { 335 | "200": { 336 | "description": "successful operation", 337 | "content": { 338 | "application/json": { 339 | "schema": { 340 | "$ref": "#/components/schemas/Order" 341 | } 342 | }, 343 | "application/xml": { 344 | "schema": { 345 | "$ref": "#/components/schemas/Order" 346 | } 347 | } 348 | } 349 | }, 350 | "400": { 351 | "description": "Invalid Order" 352 | } 353 | }, 354 | "requestBody": { 355 | "content": { 356 | "application/json": { 357 | "description": "order placed for purchasing the pet", 358 | "schema": { 359 | "$ref": "#/components/schemas/Order" 360 | } 361 | } 362 | } 363 | } 364 | } 365 | }, 366 | "/store/order/{orderId}": { 367 | "parameters": [{ 368 | "in": "path", 369 | "name": "orderId", 370 | "description": "ID of the order", 371 | "required": true, 372 | "schema": { 373 | "type": "string" 374 | } 375 | }], 376 | "get": { 377 | "tags": [ 378 | "store" 379 | ], 380 | "summary": "Find purchase order by ID", 381 | "description": "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", 382 | "operationId": "getOrderById", 383 | "responses": { 384 | "200": { 385 | "description": "successful operation", 386 | "content": { 387 | "application/json": { 388 | "schema": { 389 | "$ref": "#/components/schemas/Order" 390 | } 391 | }, 392 | "application/xml": { 393 | "schema": { 394 | "$ref": "#/components/schemas/Order" 395 | } 396 | } 397 | } 398 | }, 399 | "400": { 400 | "description": "Invalid ID supplied" 401 | }, 402 | "404": { 403 | "description": "Order not found" 404 | } 405 | } 406 | }, 407 | "delete": { 408 | "tags": [ 409 | "store" 410 | ], 411 | "summary": "Delete purchase order by ID", 412 | "description": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", 413 | "operationId": "deleteOrder", 414 | "responses": { 415 | "400": { 416 | "description": "Invalid ID supplied" 417 | }, 418 | "404": { 419 | "description": "Order not found" 420 | } 421 | } 422 | } 423 | }, 424 | "/user": { 425 | "post": { 426 | "tags": [ 427 | "user" 428 | ], 429 | "summary": "Create user", 430 | "description": "This can only be done by the logged in user.", 431 | "operationId": "createUser", 432 | "parameters": [], 433 | "responses": { 434 | "default": { 435 | "description": "successful operation" 436 | } 437 | }, 438 | "requestBody": { 439 | "content": { 440 | "application/json": { 441 | "description": "Created user object", 442 | "schema": { 443 | "$ref": "#/components/schemas/User" 444 | } 445 | } 446 | } 447 | } 448 | } 449 | }, 450 | "/user/createWithArray": { 451 | "post": { 452 | "tags": [ 453 | "user" 454 | ], 455 | "summary": "Creates list of users with given input array", 456 | "description": "", 457 | "operationId": "createUsersWithArrayInput", 458 | "parameters": [], 459 | "responses": { 460 | "default": { 461 | "description": "successful operation" 462 | } 463 | }, 464 | "requestBody": { 465 | "content": { 466 | "application/json": { 467 | "description": "List of user object", 468 | "schema": { 469 | "type": "array", 470 | "items": { 471 | "$ref": "User" 472 | } 473 | } 474 | } 475 | } 476 | } 477 | } 478 | }, 479 | "/user/createWithList": { 480 | "post": { 481 | "tags": [ 482 | "user" 483 | ], 484 | "summary": "Creates list of users with given input array", 485 | "description": "", 486 | "operationId": "createUsersWithListInput", 487 | "parameters": [], 488 | "responses": { 489 | "default": { 490 | "description": "successful operation" 491 | } 492 | }, 493 | "requestBody": { 494 | "content": { 495 | "application/json": { 496 | "description": "List of user object", 497 | "schema": { 498 | "type": "array", 499 | "items": { 500 | "$ref": "#/components/schemas/User" 501 | } 502 | } 503 | } 504 | } 505 | } 506 | } 507 | }, 508 | "/user/login": { 509 | "get": { 510 | "tags": [ 511 | "user" 512 | ], 513 | "summary": "Logs user into the system", 514 | "description": "", 515 | "operationId": "loginUser", 516 | "parameters": [{ 517 | "in": "query", 518 | "name": "username", 519 | "description": "The user name for login", 520 | "required": false, 521 | "schema": { 522 | "type": "string" 523 | } 524 | }, { 525 | "in": "query", 526 | "name": "password", 527 | "description": "The password for login in clear text", 528 | "required": false, 529 | "schema": { 530 | "type": "string", 531 | "format": "password" 532 | } 533 | }], 534 | "responses": { 535 | "200": { 536 | "description": "successful operation", 537 | "content": { 538 | "application/json": { 539 | "schema": { 540 | "type": "string" 541 | } 542 | }, 543 | "application/xml": { 544 | "schema": { 545 | "type": "string" 546 | } 547 | } 548 | } 549 | }, 550 | "400": { 551 | "description": "Invalid username/password supplied" 552 | } 553 | } 554 | } 555 | }, 556 | "/user/logout": { 557 | "get": { 558 | "tags": [ 559 | "user" 560 | ], 561 | "summary": "Logs out current logged in user session", 562 | "description": "", 563 | "operationId": "logoutUser", 564 | "responses": { 565 | "default": { 566 | "description": "successful operation" 567 | } 568 | } 569 | } 570 | }, 571 | "/user/{username}": { 572 | "parameters": [{ 573 | "in": "path", 574 | "name": "username", 575 | "description": "The user name", 576 | "required": true, 577 | "schema": { 578 | "type": "string" 579 | } 580 | }], 581 | "get": { 582 | "tags": [ 583 | "user" 584 | ], 585 | "summary": "Get user by user name", 586 | "description": "", 587 | "operationId": "getUserByName", 588 | "responses": { 589 | "200": { 590 | "description": "successful operation", 591 | "content": { 592 | "application/json": { 593 | "schema": { 594 | "$ref": "#/components/schemas/User" 595 | } 596 | }, 597 | "application/xml": { 598 | "schema": { 599 | "$ref": "#/components/schemas/User" 600 | } 601 | } 602 | } 603 | }, 604 | "400": { 605 | "description": "Invalid username supplied" 606 | }, 607 | "404": { 608 | "description": "User not found" 609 | } 610 | } 611 | }, 612 | "put": { 613 | "tags": [ 614 | "user" 615 | ], 616 | "summary": "Updated user", 617 | "description": "This can only be done by the logged in user.", 618 | "operationId": "updateUser", 619 | "responses": { 620 | "400": { 621 | "description": "Invalid user supplied" 622 | }, 623 | "404": { 624 | "description": "User not found" 625 | } 626 | }, 627 | "requestBody": { 628 | "content": { 629 | "application/json": { 630 | "description": "Updated user object", 631 | "schema": { 632 | "$ref": "#/components/schemas/User" 633 | } 634 | } 635 | } 636 | } 637 | }, 638 | "delete": { 639 | "tags": [ 640 | "user" 641 | ], 642 | "summary": "Delete user", 643 | "description": "This can only be done by the logged in user.", 644 | "operationId": "deleteUser", 645 | "responses": { 646 | "400": { 647 | "description": "Invalid username supplied" 648 | }, 649 | "404": { 650 | "description": "User not found" 651 | } 652 | } 653 | } 654 | } 655 | }, 656 | "components": { 657 | "schemas": { 658 | "User": { 659 | "properties": { 660 | "id": { 661 | "type": "integer", 662 | "format": "int64", 663 | "xml": { 664 | "name": "id" 665 | } 666 | }, 667 | "username": { 668 | "type": "string", 669 | "xml": { 670 | "name": "username" 671 | } 672 | }, 673 | "firstName": { 674 | "type": "string", 675 | "xml": { 676 | "name": "firstName" 677 | } 678 | }, 679 | "lastName": { 680 | "type": "string", 681 | "xml": { 682 | "name": "lastName" 683 | } 684 | }, 685 | "email": { 686 | "type": "string", 687 | "xml": { 688 | "name": "email" 689 | } 690 | }, 691 | "password": { 692 | "type": "string", 693 | "xml": { 694 | "name": "password" 695 | } 696 | }, 697 | "phone": { 698 | "type": "string", 699 | "xml": { 700 | "name": "phone" 701 | } 702 | }, 703 | "userStatus": { 704 | "type": "integer", 705 | "format": "int32", 706 | "xml": { 707 | "name": "userStatus" 708 | }, 709 | "description": "User Status" 710 | } 711 | }, 712 | "xml": { 713 | "name": "User" 714 | } 715 | }, 716 | "Category": { 717 | "properties": { 718 | "id": { 719 | "type": "integer", 720 | "format": "int64", 721 | "xml": { 722 | "name": "id" 723 | } 724 | }, 725 | "name": { 726 | "type": "string", 727 | "xml": { 728 | "name": "name" 729 | } 730 | } 731 | }, 732 | "xml": { 733 | "name": "Category" 734 | } 735 | }, 736 | "Pet": { 737 | "required": [ 738 | "name", 739 | "photoUrls" 740 | ], 741 | "properties": { 742 | "id": { 743 | "type": "integer", 744 | "format": "int64", 745 | "xml": { 746 | "name": "id" 747 | } 748 | }, 749 | "category": { 750 | "xml": { 751 | "name": "category" 752 | }, 753 | "$ref": "#/components/schemas/Category" 754 | }, 755 | "name": { 756 | "type": "string", 757 | "example": "doggie", 758 | "xml": { 759 | "name": "name" 760 | } 761 | }, 762 | "photoUrls": { 763 | "type": "array", 764 | "xml": { 765 | "name": "photoUrl", 766 | "wrapped": true 767 | }, 768 | "items": { 769 | "type": "string" 770 | } 771 | }, 772 | "tags": { 773 | "type": "array", 774 | "xml": { 775 | "name": "tag", 776 | "wrapped": true 777 | }, 778 | "items": { 779 | "$ref": "#/components/schemas/Tag" 780 | } 781 | }, 782 | "status": { 783 | "type": "string", 784 | "xml": { 785 | "name": "status" 786 | }, 787 | "description": "pet status in the store" 788 | } 789 | }, 790 | "xml": { 791 | "name": "Pet" 792 | } 793 | }, 794 | "Tag": { 795 | "properties": { 796 | "id": { 797 | "type": "integer", 798 | "format": "int64", 799 | "xml": { 800 | "name": "id" 801 | } 802 | }, 803 | "name": { 804 | "type": "string", 805 | "xml": { 806 | "name": "name" 807 | } 808 | } 809 | }, 810 | "xml": { 811 | "name": "Tag" 812 | } 813 | }, 814 | "Order": { 815 | "properties": { 816 | "id": { 817 | "type": "integer", 818 | "format": "int64", 819 | "xml": { 820 | "name": "id" 821 | } 822 | }, 823 | "petId": { 824 | "type": "integer", 825 | "format": "int64", 826 | "xml": { 827 | "name": "petId" 828 | } 829 | }, 830 | "quantity": { 831 | "type": "integer", 832 | "format": "int32", 833 | "xml": { 834 | "name": "quantity" 835 | } 836 | }, 837 | "shipDate": { 838 | "type": "string", 839 | "format": "date-time", 840 | "xml": { 841 | "name": "shipDate" 842 | } 843 | }, 844 | "status": { 845 | "type": "string", 846 | "xml": { 847 | "name": "status" 848 | }, 849 | "description": "Order Status" 850 | }, 851 | "complete": { 852 | "type": "boolean" 853 | } 854 | }, 855 | "xml": { 856 | "name": "Order" 857 | } 858 | } 859 | }, 860 | "responses": {}, 861 | "parameters": {}, 862 | "examples": {}, 863 | "requestBodies": { 864 | "requestBody1": { 865 | "content": { 866 | "application/json": { 867 | "description": "Pet object that needs to be added to the store", 868 | "schema": { 869 | "$ref": "#/components/schemas/Pet" 870 | }, 871 | "example": { 872 | "name": "rex", 873 | "photoUrls": [] 874 | } 875 | }, 876 | "application/xml": { 877 | "description": "Pet object that needs to be added to the store" 878 | } 879 | } 880 | } 881 | }, 882 | "securitySchemes": { 883 | "api_key": { 884 | "type": "apiKey", 885 | "name": "api_key", 886 | "in": "header" 887 | }, 888 | "petstore_auth": { 889 | "type": "oauth2", 890 | "flow": { 891 | "implicit": { 892 | "authorizationUrl": "http://petstore.swagger.io/api/oauth/dialog", 893 | "scopes": {} 894 | } 895 | } 896 | } 897 | }, 898 | "headers": {} 899 | } 900 | } 901 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var webpack = require('webpack') 3 | 4 | module.exports = { 5 | entry: './test/app.js', 6 | output: { 7 | filename: 'bundle.js', 8 | path: path.resolve(__dirname, './test'), 9 | publicPath: '/' 10 | }, 11 | module: { 12 | rules: [ 13 | { 14 | test: /\.vue$/, 15 | loader: 'vue-loader' 16 | }, { 17 | test: /\.js$/, 18 | exclude: /(node_modules|bower_components)/, 19 | loader: 'babel-loader' 20 | }, { 21 | test: /\.css$/, 22 | loader: process.env.NODE_ENV !== 'development' ? 'style-loader!css-loader?minimize' : 'style-loader!css-loader?-minimize' 23 | }, { 24 | test: /\.json$/, 25 | loader: 'json-loader' 26 | } 27 | ] 28 | }, 29 | resolve: { 30 | alias: { 31 | 'vue$': 'vue/dist/vue.esm.js' 32 | } 33 | }, 34 | devServer: { 35 | historyApiFallback: false, 36 | noInfo: false, 37 | proxy: [{ 38 | context: ['/wotapps', '/avatars', '/registry'], 39 | target: 'http://localhost:9999', 40 | secure: false 41 | }] 42 | }, 43 | devtool: '#eval' 44 | } 45 | 46 | if (process.env.NODE_ENV === 'production') { 47 | module.exports.devtool = '#source-map' 48 | // http://vue-loader.vuejs.org/en/workflow/production.html 49 | module.exports.plugins = (module.exports.plugins || []).concat([ 50 | new webpack.DefinePlugin({ 51 | 'process.env': { 52 | NODE_ENV: '"production"' 53 | } 54 | }), 55 | new webpack.optimize.UglifyJsPlugin({ 56 | sourceMap: true, 57 | compress: { 58 | warnings: false 59 | } 60 | }), 61 | new webpack.LoaderOptionsPlugin({ 62 | minimize: true 63 | }) 64 | ]) 65 | } 66 | --------------------------------------------------------------------------------