Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

passage des specs en openapi 3.0.0 #110

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
212 changes: 121 additions & 91 deletions doc/aoc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
swagger: '2.0'

openapi: '3.1.0'
info:
version: '2.7.7'
title: API Carto Appellations viticoles
description: >
Le module appellations viticoles permet de récupérer les zones intersectant une géométrie GeoJSON.
Expand Down Expand Up @@ -40,114 +40,144 @@ info:
* Linéaire :

`{"type":"LineString","coordinates":[[4.681549,47.793784],[4.741974,47.788248]]}`



consumes:
- application/json
produces:
- application/json

basePath: /api

servers:
- url: https://apicarto.ign.fr
paths:
/aoc/appellation-viticole:
/api/aoc/appellation-viticole:
post:
operationId: postAppellationViticole
description: |
Prend une geometrie de type GeoJSON en paramètre d'entrée et renvoie les appellations viticoles intersectantes
consumes:
- application/x-www-form-urlencoded
Paramètres de sorties : Retourne un résultat de Type "FeatureCollection"
parameters:

- name: geom
in: query
required: true
schema:
$ref: "#/definitions/Geometry"
$ref: "#/components/schemas/Geometry"

tags:
- Appellations viticoles
responses:
'200':
description: "Succès"
schema:
$ref: "#/definitions/FeatureCollectionAppellationViticole"
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/FeatureCollectionAppellationViticole'
'400':
description: "Paramètres invalide"
schema:
$ref: "#/definitions/Error"
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Error'
'500':
description: "Erreur dans le traitement de la requête"
schema:
$ref: "#/definitions/Error"

definitions:


FeatureAppellationViticole:
description: "Objet géographique appellation viticole"
type: object
allOf:
- $ref: "#/definitions/Feature"
properties:
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Error'

components:
schemas:
Geometry:
type: object
description: Une `Geometry` au sens GeoJSON
properties:
type:
type: string
description: Le type géométrique
enum:
- Point
- LineString
- Polygon
- MultiPoint
- MultiLineString
- MultiPolygon
coordinates:
type: array
items: {}
Feature:
type: object
description: Une `Feature` au sens GeoJSON
properties:
type:
type: string
description: Le type d'objet GeoJSON (`Feature`)
id:
type: string
geometry:
$ref: '#/components/schemas/Geometry'
MultiPolygon:
type: object
description: Un `MultiPolygon` au sens GeoJSON
properties:
type:
type: string
description: Le type géométrique (`MultiPolygon`)
coordinates:
type: array
items: {}

FeatureAppellationViticole:
description: Objet géographique appellation viticole
type: object
allOf:
- $ref: "#/components/schemas/Feature"
properties:
type: object
properties:
appelation:
type: string
idapp:
type: string
id_uni:
type: string
description: corresponds à "segment-idapp-insee"
insee:
type: string
segment:
type: string
instruction_obligatoire:
type: boolean
granularite:
type: string
enum:
- commune
- exacte
appellation:
type: string
contains:
type: boolean
geometry:
$ref: '#/definitions/MultiPolygon'

FeatureCollectionAppellationViticole:
description: "Liste d'objet géographique appellation viticole"
type: object
properties:
type:
type: string
enum:
- FeatureCollection
features:
type: array
items:
$ref: '#/definitions/FeatureAppellationViticole'

Error:
required:
- code
- message
properties:
code:
type: string
message:
type: string

# import definitions
FeatureCollection:
$ref: './schema/geojson.yml#definitions/FeatureCollection'
Feature:
$ref: './schema/geojson.yml#definitions/Feature'
Geometry:
$ref: './schema/geojson.yml#definitions/Geometry'
MultiPolygon:
$ref: './schema/geojson.yml#definitions/MultiPolygon'
type: object
properties:
appelation:
type: string
idapp:
type: string
id_uni:
type: string
description: corresponds à "segment-idapp-insee"
insee:
type: string
segment:
type: string
instruction_obligatoire:
type: boolean
granularite:
type: string
enum:
- commune
- exacte
appellation:
type: string
contains:
type: boolean
geometry:
$ref: '#/components/schemas/MultiPolygon'

FeatureCollectionAppellationViticole:
description: "Liste d'objet géographique appellation viticole"
type: object
properties:
type:
type: string
enum:
- FeatureCollection
features:
type: array
items:
$ref: '#/components/schemas/FeatureAppellationViticole'

Error:
required:
- code
- message
properties:
code:
type: string
message:
type: string
Loading
Loading