api_geo_client 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +69 -0
- data/LICENSE +21 -0
- data/README.md +106 -0
- data/Rakefile +9 -0
- data/api_geo_client.gemspec +45 -0
- data/api_geo_spec.yml +413 -0
- data/config.json +10 -0
- data/docs/Commune.md +18 -0
- data/docs/CommunesApi.md +183 -0
- data/docs/Departement.md +11 -0
- data/docs/DpartementsApi.md +215 -0
- data/docs/Error.md +10 -0
- data/docs/Region.md +9 -0
- data/docs/RgionsApi.md +159 -0
- data/git_push.sh +55 -0
- data/lib/api_geo_client.rb +46 -0
- data/lib/api_geo_client/api/communes_api.rb +245 -0
- data/lib/api_geo_client/api/dpartements_api.rb +262 -0
- data/lib/api_geo_client/api/rgions_api.rb +191 -0
- data/lib/api_geo_client/api_client.rb +388 -0
- data/lib/api_geo_client/api_error.rb +38 -0
- data/lib/api_geo_client/configuration.rb +202 -0
- data/lib/api_geo_client/models/commune.rb +284 -0
- data/lib/api_geo_client/models/departement.rb +213 -0
- data/lib/api_geo_client/models/error.rb +204 -0
- data/lib/api_geo_client/models/region.rb +194 -0
- data/lib/api_geo_client/version.rb +15 -0
- data/spec/api/communes_api_spec.rb +84 -0
- data/spec/api/dpartements_api_spec.rb +87 -0
- data/spec/api/rgions_api_spec.rb +72 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/commune_spec.rb +101 -0
- data/spec/models/departement_spec.rb +59 -0
- data/spec/models/error_spec.rb +53 -0
- data/spec/models/region_spec.rb +47 -0
- data/spec/spec_helper.rb +111 -0
- metadata +272 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b7f9c76f67edc6ce2859ebaae91229b512be3d927826a91cccac30b79edade45
|
4
|
+
data.tar.gz: 7901c108fbc64050a9b653ee76eaa719cee7564fe021c9cc8cc48de4190436c8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b9633bc688e1c815e95e80b2bc0822c12c1b9abfa3cbbcf059ace24f50422b46d51f5ea9000d17bb3eeccf68f55b1cafe28804617cb97bcd0891ddc53e2cd4fd
|
7
|
+
data.tar.gz: '0536188a4857bf3a9b74f5c86cf23c278fa77d3f89e921c4900a9139b4be23c0b4ec665e7ce353e6609cce994535bac6f98669602ac4ca42ef7a48c2155d4674'
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
api_geo_client (1.0.0)
|
5
|
+
json (~> 2.1, >= 2.1.0)
|
6
|
+
typhoeus (~> 1.0, >= 1.0.1)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
ZenTest (4.11.2)
|
12
|
+
addressable (2.6.0)
|
13
|
+
public_suffix (>= 2.0.2, < 4.0)
|
14
|
+
autotest (4.4.6)
|
15
|
+
ZenTest (>= 4.4.1)
|
16
|
+
autotest-fsevent (0.2.14)
|
17
|
+
sys-uname
|
18
|
+
autotest-growl (0.2.16)
|
19
|
+
autotest-rails-pure (4.1.2)
|
20
|
+
crack (0.4.3)
|
21
|
+
safe_yaml (~> 1.0.0)
|
22
|
+
diff-lcs (1.3)
|
23
|
+
ethon (0.12.0)
|
24
|
+
ffi (>= 1.3.0)
|
25
|
+
ffi (1.11.1)
|
26
|
+
hashdiff (0.4.0)
|
27
|
+
json (2.2.0)
|
28
|
+
public_suffix (3.1.0)
|
29
|
+
rake (12.0.0)
|
30
|
+
rspec (3.8.0)
|
31
|
+
rspec-core (~> 3.8.0)
|
32
|
+
rspec-expectations (~> 3.8.0)
|
33
|
+
rspec-mocks (~> 3.8.0)
|
34
|
+
rspec-core (3.8.0)
|
35
|
+
rspec-support (~> 3.8.0)
|
36
|
+
rspec-expectations (3.8.3)
|
37
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
38
|
+
rspec-support (~> 3.8.0)
|
39
|
+
rspec-mocks (3.8.0)
|
40
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
41
|
+
rspec-support (~> 3.8.0)
|
42
|
+
rspec-support (3.8.0)
|
43
|
+
safe_yaml (1.0.5)
|
44
|
+
sys-uname (1.0.4)
|
45
|
+
ffi (>= 1.0.0)
|
46
|
+
typhoeus (1.3.1)
|
47
|
+
ethon (>= 0.9.0)
|
48
|
+
vcr (3.0.3)
|
49
|
+
webmock (1.24.6)
|
50
|
+
addressable (>= 2.3.6)
|
51
|
+
crack (>= 0.3.2)
|
52
|
+
hashdiff
|
53
|
+
|
54
|
+
PLATFORMS
|
55
|
+
ruby
|
56
|
+
|
57
|
+
DEPENDENCIES
|
58
|
+
api_geo_client!
|
59
|
+
autotest (~> 4.4, >= 4.4.6)
|
60
|
+
autotest-fsevent (~> 0.2, >= 0.2.12)
|
61
|
+
autotest-growl (~> 0.2, >= 0.2.16)
|
62
|
+
autotest-rails-pure (~> 4.1, >= 4.1.2)
|
63
|
+
rake (~> 12.0.0)
|
64
|
+
rspec (~> 3.6, >= 3.6.0)
|
65
|
+
vcr (~> 3.0, >= 3.0.1)
|
66
|
+
webmock (~> 1.24, >= 1.24.3)
|
67
|
+
|
68
|
+
BUNDLED WITH
|
69
|
+
1.17.2
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2019 Cashbee
|
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 all
|
13
|
+
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 THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
# api_geo_client
|
2
|
+
|
3
|
+
ApiGeoClient - the Ruby gem for the API Référentiels géographiques
|
4
|
+
|
5
|
+
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
6
|
+
|
7
|
+
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
8
|
+
|
9
|
+
- API version: 1.0.0-beta
|
10
|
+
- Package version: 1.0.0
|
11
|
+
- Build package: io.swagger.codegen.languages.RubyClientCodegen
|
12
|
+
|
13
|
+
## Installation
|
14
|
+
|
15
|
+
### Build a gem
|
16
|
+
|
17
|
+
To build the Ruby code into a gem:
|
18
|
+
|
19
|
+
```shell
|
20
|
+
gem build api_geo_client.gemspec
|
21
|
+
```
|
22
|
+
|
23
|
+
Then either install the gem locally:
|
24
|
+
|
25
|
+
```shell
|
26
|
+
gem install ./api_geo_client-1.0.0.gem
|
27
|
+
```
|
28
|
+
(for development, run `gem install --dev ./api_geo_client-1.0.0.gem` to install the development dependencies)
|
29
|
+
|
30
|
+
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
31
|
+
|
32
|
+
Finally add this to the Gemfile:
|
33
|
+
|
34
|
+
gem 'api_geo_client', '~> 1.0.0'
|
35
|
+
|
36
|
+
### Install from Git
|
37
|
+
|
38
|
+
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
|
39
|
+
|
40
|
+
gem 'api_geo_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
|
41
|
+
|
42
|
+
### Include the Ruby code directly
|
43
|
+
|
44
|
+
Include the Ruby code directly using `-I` as follows:
|
45
|
+
|
46
|
+
```shell
|
47
|
+
ruby -Ilib script.rb
|
48
|
+
```
|
49
|
+
|
50
|
+
## Getting Started
|
51
|
+
|
52
|
+
Please follow the [installation](#installation) procedure and then run the following code:
|
53
|
+
```ruby
|
54
|
+
# Load the gem
|
55
|
+
require 'api_geo_client'
|
56
|
+
|
57
|
+
api_instance = ApiGeoClient::CommunesApi.new
|
58
|
+
|
59
|
+
code = 'code_example' # String | Code INSEE de la commune
|
60
|
+
|
61
|
+
opts = {
|
62
|
+
fields: ['[\"nom\",\"code\",\"codesPostaux\",\"codeDepartement\",\"codeRegion\",\"population\"]'], # Array<String> | Liste des champs souhaités dans la réponse
|
63
|
+
format: 'json', # String | Format de réponse attendu
|
64
|
+
geometry: 'centre' # String | Géométrie à utiliser pour la sortie géographique
|
65
|
+
}
|
66
|
+
|
67
|
+
begin
|
68
|
+
#Récupérer les informations concernant une commune
|
69
|
+
result = api_instance.communes_code_get(code, opts)
|
70
|
+
p result
|
71
|
+
rescue ApiGeoClient::ApiError => e
|
72
|
+
puts "Exception when calling CommunesApi->communes_code_get: #{e}"
|
73
|
+
end
|
74
|
+
|
75
|
+
```
|
76
|
+
|
77
|
+
## Documentation for API Endpoints
|
78
|
+
|
79
|
+
All URIs are relative to *https://geo.api.gouv.fr*
|
80
|
+
|
81
|
+
Class | Method | HTTP request | Description
|
82
|
+
------------ | ------------- | ------------- | -------------
|
83
|
+
*ApiGeoClient::CommunesApi* | [**communes_code_get**](docs/CommunesApi.md#communes_code_get) | **GET** /communes/{code} | Récupérer les informations concernant une commune
|
84
|
+
*ApiGeoClient::CommunesApi* | [**communes_get**](docs/CommunesApi.md#communes_get) | **GET** /communes | Recherche des communes
|
85
|
+
*ApiGeoClient::CommunesApi* | [**departements_code_communes_get**](docs/CommunesApi.md#departements_code_communes_get) | **GET** /departements/{code}/communes | Renvoi les communes d'un département
|
86
|
+
*ApiGeoClient::DpartementsApi* | [**departements_code_communes_get**](docs/DpartementsApi.md#departements_code_communes_get) | **GET** /departements/{code}/communes | Renvoi les communes d'un département
|
87
|
+
*ApiGeoClient::DpartementsApi* | [**departements_code_get**](docs/DpartementsApi.md#departements_code_get) | **GET** /departements/{code} | Récupérer les informations concernant un département
|
88
|
+
*ApiGeoClient::DpartementsApi* | [**departements_get**](docs/DpartementsApi.md#departements_get) | **GET** /departements | Recherche des départements
|
89
|
+
*ApiGeoClient::DpartementsApi* | [**regions_code_departements_get**](docs/DpartementsApi.md#regions_code_departements_get) | **GET** /regions/{code}/departements | Renvoi les départements d'une région
|
90
|
+
*ApiGeoClient::RgionsApi* | [**regions_code_departements_get**](docs/RgionsApi.md#regions_code_departements_get) | **GET** /regions/{code}/departements | Renvoi les départements d'une région
|
91
|
+
*ApiGeoClient::RgionsApi* | [**regions_code_get**](docs/RgionsApi.md#regions_code_get) | **GET** /regions/{code} | Récupérer les informations concernant une région
|
92
|
+
*ApiGeoClient::RgionsApi* | [**regions_get**](docs/RgionsApi.md#regions_get) | **GET** /regions | Recherche des régions
|
93
|
+
|
94
|
+
|
95
|
+
## Documentation for Models
|
96
|
+
|
97
|
+
- [ApiGeoClient::Commune](docs/Commune.md)
|
98
|
+
- [ApiGeoClient::Departement](docs/Departement.md)
|
99
|
+
- [ApiGeoClient::Error](docs/Error.md)
|
100
|
+
- [ApiGeoClient::Region](docs/Region.md)
|
101
|
+
|
102
|
+
|
103
|
+
## Documentation for Authorization
|
104
|
+
|
105
|
+
All endpoints do not require authorization.
|
106
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
=begin
|
4
|
+
#API Référentiels géographiques
|
5
|
+
|
6
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
7
|
+
|
8
|
+
OpenAPI spec version: 1.0.0-beta
|
9
|
+
|
10
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
11
|
+
Swagger Codegen version: 2.4.5
|
12
|
+
|
13
|
+
=end
|
14
|
+
|
15
|
+
$:.push File.expand_path("../lib", __FILE__)
|
16
|
+
require "api_geo_client/version"
|
17
|
+
|
18
|
+
Gem::Specification.new do |s|
|
19
|
+
s.name = "api_geo_client"
|
20
|
+
s.version = ApiGeoClient::VERSION
|
21
|
+
s.platform = Gem::Platform::RUBY
|
22
|
+
s.authors = ["Armand Mégrot"]
|
23
|
+
s.email = ["armand.megrot@cashbee.fr"]
|
24
|
+
s.homepage = "https://github.com/cashbee-team/api_geo_client"
|
25
|
+
s.summary = "API Géo Ruby Gem"
|
26
|
+
s.description = "API Géo. More info at https://api.gouv.fr/api/api-geo.html. Generated by Cashbee https://www.cashbee.fr"
|
27
|
+
s.license = 'MIT'
|
28
|
+
s.required_ruby_version = ">= 1.9"
|
29
|
+
|
30
|
+
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
31
|
+
s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
|
32
|
+
|
33
|
+
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
34
|
+
s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1'
|
35
|
+
s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3'
|
36
|
+
s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6'
|
37
|
+
s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2'
|
38
|
+
s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
|
39
|
+
s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12'
|
40
|
+
|
41
|
+
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
|
42
|
+
s.test_files = `find spec/*`.split("\n")
|
43
|
+
s.executables = []
|
44
|
+
s.require_paths = ["lib"]
|
45
|
+
end
|
data/api_geo_spec.yml
ADDED
@@ -0,0 +1,413 @@
|
|
1
|
+
swagger: '2.0'
|
2
|
+
info:
|
3
|
+
title: API Référentiels géographiques
|
4
|
+
version: '1.0.0-beta'
|
5
|
+
host: geo.api.gouv.fr
|
6
|
+
schemes:
|
7
|
+
- https
|
8
|
+
produces:
|
9
|
+
- application/json
|
10
|
+
parameters:
|
11
|
+
communeFieldsParam:
|
12
|
+
name: fields
|
13
|
+
in: query
|
14
|
+
description: Liste des champs souhaités dans la réponse
|
15
|
+
type: array
|
16
|
+
items:
|
17
|
+
type: string
|
18
|
+
enum:
|
19
|
+
- nom
|
20
|
+
- code
|
21
|
+
- codesPostaux
|
22
|
+
- centre
|
23
|
+
- surface
|
24
|
+
- contour
|
25
|
+
- codeDepartement
|
26
|
+
- departement
|
27
|
+
- codeRegion
|
28
|
+
- region
|
29
|
+
- population
|
30
|
+
collectionFormat: csv
|
31
|
+
default:
|
32
|
+
- nom
|
33
|
+
- code
|
34
|
+
- codesPostaux
|
35
|
+
- codeDepartement
|
36
|
+
- codeRegion
|
37
|
+
- population
|
38
|
+
departementFieldsParam:
|
39
|
+
name: fields
|
40
|
+
in: query
|
41
|
+
description: Liste des champs souhaités dans la réponse
|
42
|
+
type: array
|
43
|
+
items:
|
44
|
+
type: string
|
45
|
+
enum:
|
46
|
+
- nom
|
47
|
+
- code
|
48
|
+
- codeRegion
|
49
|
+
- region
|
50
|
+
collectionFormat: csv
|
51
|
+
default:
|
52
|
+
- nom
|
53
|
+
- code
|
54
|
+
- codeRegion
|
55
|
+
regionFieldsParam:
|
56
|
+
name: fields
|
57
|
+
in: query
|
58
|
+
description: Liste des champs souhaités dans la réponse
|
59
|
+
type: array
|
60
|
+
items:
|
61
|
+
type: string
|
62
|
+
enum:
|
63
|
+
- nom
|
64
|
+
- code
|
65
|
+
collectionFormat: csv
|
66
|
+
default:
|
67
|
+
- nom
|
68
|
+
- code
|
69
|
+
formatParam:
|
70
|
+
name: format
|
71
|
+
in: query
|
72
|
+
description: Format de réponse attendu
|
73
|
+
type: string
|
74
|
+
enum: ['json', 'geojson']
|
75
|
+
default: json
|
76
|
+
communeGeometryParam:
|
77
|
+
name: geometry
|
78
|
+
in: query
|
79
|
+
description: Géométrie à utiliser pour la sortie géographique
|
80
|
+
type: string
|
81
|
+
enum: ['centre', 'contour']
|
82
|
+
default: centre
|
83
|
+
limitParam:
|
84
|
+
name: limit
|
85
|
+
in: query
|
86
|
+
description: Nombre d'éléments à retourner
|
87
|
+
type: integer
|
88
|
+
format: int32
|
89
|
+
default: 0
|
90
|
+
paths:
|
91
|
+
/communes:
|
92
|
+
get:
|
93
|
+
summary: Recherche des communes
|
94
|
+
tags:
|
95
|
+
- Communes
|
96
|
+
parameters:
|
97
|
+
- name: codePostal
|
98
|
+
in: query
|
99
|
+
description: Code postal associé
|
100
|
+
type: string
|
101
|
+
- name: lat
|
102
|
+
in: query
|
103
|
+
description: Latitude (en degrés)
|
104
|
+
type: number
|
105
|
+
format: float
|
106
|
+
- name: lon
|
107
|
+
in: query
|
108
|
+
description: Longitude (en degrés)
|
109
|
+
type: number
|
110
|
+
format: float
|
111
|
+
- name: nom
|
112
|
+
in: query
|
113
|
+
description: Nom de la commune
|
114
|
+
type: string
|
115
|
+
- name: boost
|
116
|
+
in: query
|
117
|
+
description: Mode de boost de la recherche par nom
|
118
|
+
type: string
|
119
|
+
- name: code
|
120
|
+
in: query
|
121
|
+
description: Code de la commune
|
122
|
+
type: string
|
123
|
+
- name: codeDepartement
|
124
|
+
in: query
|
125
|
+
description: Code du département associé
|
126
|
+
type: string
|
127
|
+
- name: codeRegion
|
128
|
+
in: query
|
129
|
+
description: Code de la région associée
|
130
|
+
type: string
|
131
|
+
- $ref: '#/parameters/communeFieldsParam'
|
132
|
+
- $ref: '#/parameters/formatParam'
|
133
|
+
- $ref: '#/parameters/communeGeometryParam'
|
134
|
+
responses:
|
135
|
+
200:
|
136
|
+
description: Liste de communes
|
137
|
+
schema:
|
138
|
+
type: array
|
139
|
+
items:
|
140
|
+
$ref: '#/definitions/Commune'
|
141
|
+
400:
|
142
|
+
description: Erreur. Requête mal formée
|
143
|
+
schema:
|
144
|
+
$ref: '#/definitions/Error'
|
145
|
+
|
146
|
+
|
147
|
+
/communes/{code}:
|
148
|
+
get:
|
149
|
+
summary: Récupérer les informations concernant une commune
|
150
|
+
tags:
|
151
|
+
- Communes
|
152
|
+
parameters:
|
153
|
+
- name: code
|
154
|
+
in: path
|
155
|
+
description: Code INSEE de la commune
|
156
|
+
required: true
|
157
|
+
type: string
|
158
|
+
- $ref: '#/parameters/communeFieldsParam'
|
159
|
+
- $ref: '#/parameters/formatParam'
|
160
|
+
- $ref: '#/parameters/communeGeometryParam'
|
161
|
+
responses:
|
162
|
+
200:
|
163
|
+
description: Informations concernant une commune
|
164
|
+
schema:
|
165
|
+
$ref: '#/definitions/Commune'
|
166
|
+
400:
|
167
|
+
description: Erreur. Requête mal formée
|
168
|
+
schema:
|
169
|
+
$ref: '#/definitions/Error'
|
170
|
+
404:
|
171
|
+
description: Commune introuvable
|
172
|
+
schema:
|
173
|
+
$ref: '#/definitions/Error'
|
174
|
+
|
175
|
+
/departements:
|
176
|
+
get:
|
177
|
+
summary: Recherche des départements
|
178
|
+
tags:
|
179
|
+
- Départements
|
180
|
+
parameters:
|
181
|
+
- name: code
|
182
|
+
in: query
|
183
|
+
description: Code du département
|
184
|
+
type: string
|
185
|
+
- name: codeRegion
|
186
|
+
in: query
|
187
|
+
description: Code région associé
|
188
|
+
type: string
|
189
|
+
- name: nom
|
190
|
+
in: query
|
191
|
+
description: Nom du département
|
192
|
+
type: string
|
193
|
+
- $ref: '#/parameters/departementFieldsParam'
|
194
|
+
responses:
|
195
|
+
200:
|
196
|
+
description: Le ou les départements
|
197
|
+
schema:
|
198
|
+
type: array
|
199
|
+
items:
|
200
|
+
$ref: '#/definitions/Departement'
|
201
|
+
400:
|
202
|
+
description: Erreur. Requête mal formée
|
203
|
+
schema:
|
204
|
+
$ref: '#/definitions/Error'
|
205
|
+
|
206
|
+
/departements/{code}:
|
207
|
+
get:
|
208
|
+
summary: Récupérer les informations concernant un département
|
209
|
+
tags:
|
210
|
+
- Départements
|
211
|
+
parameters:
|
212
|
+
- name: code
|
213
|
+
in: path
|
214
|
+
description: Code du département
|
215
|
+
required: true
|
216
|
+
type: string
|
217
|
+
- $ref: '#/parameters/departementFieldsParam'
|
218
|
+
responses:
|
219
|
+
200:
|
220
|
+
description: Informations concernant un département
|
221
|
+
schema:
|
222
|
+
$ref: '#/definitions/Departement'
|
223
|
+
400:
|
224
|
+
description: Erreur. Requête mal formée
|
225
|
+
schema:
|
226
|
+
$ref: '#/definitions/Error'
|
227
|
+
404:
|
228
|
+
description: Département introuvable
|
229
|
+
schema:
|
230
|
+
$ref: '#/definitions/Error'
|
231
|
+
|
232
|
+
/departements/{code}/communes:
|
233
|
+
get:
|
234
|
+
summary: Renvoi les communes d'un département
|
235
|
+
tags:
|
236
|
+
- Départements
|
237
|
+
- Communes
|
238
|
+
parameters:
|
239
|
+
- name: code
|
240
|
+
in: path
|
241
|
+
description: Code du département
|
242
|
+
required: true
|
243
|
+
type: string
|
244
|
+
- $ref: '#/parameters/communeFieldsParam'
|
245
|
+
- $ref: '#/parameters/formatParam'
|
246
|
+
- $ref: '#/parameters/communeGeometryParam'
|
247
|
+
responses:
|
248
|
+
200:
|
249
|
+
description: Liste des communes du département
|
250
|
+
schema:
|
251
|
+
$ref: '#/definitions/Commune'
|
252
|
+
400:
|
253
|
+
description: Erreur. Requête mal formée
|
254
|
+
schema:
|
255
|
+
$ref: '#/definitions/Error'
|
256
|
+
404:
|
257
|
+
description: Département introuvable
|
258
|
+
schema:
|
259
|
+
$ref: '#/definitions/Error'
|
260
|
+
|
261
|
+
/regions:
|
262
|
+
get:
|
263
|
+
summary: Recherche des régions
|
264
|
+
tags:
|
265
|
+
- Régions
|
266
|
+
parameters:
|
267
|
+
- name: code
|
268
|
+
in: query
|
269
|
+
description: Code de la région
|
270
|
+
type: string
|
271
|
+
- name: nom
|
272
|
+
in: query
|
273
|
+
description: Nom de la région
|
274
|
+
type: string
|
275
|
+
- $ref: '#/parameters/regionFieldsParam'
|
276
|
+
responses:
|
277
|
+
200:
|
278
|
+
description: La ou les régions
|
279
|
+
schema:
|
280
|
+
type: array
|
281
|
+
items:
|
282
|
+
$ref: '#/definitions/Region'
|
283
|
+
400:
|
284
|
+
description: Erreur. Requête mal formée
|
285
|
+
schema:
|
286
|
+
$ref: '#/definitions/Error'
|
287
|
+
|
288
|
+
/regions/{code}:
|
289
|
+
get:
|
290
|
+
summary: Récupérer les informations concernant une région
|
291
|
+
tags:
|
292
|
+
- Régions
|
293
|
+
parameters:
|
294
|
+
- name: code
|
295
|
+
in: path
|
296
|
+
description: Code de la région
|
297
|
+
required: true
|
298
|
+
type: string
|
299
|
+
- $ref: '#/parameters/regionFieldsParam'
|
300
|
+
responses:
|
301
|
+
200:
|
302
|
+
description: Informations concernant la région
|
303
|
+
schema:
|
304
|
+
$ref: '#/definitions/Departement'
|
305
|
+
400:
|
306
|
+
description: Erreur. Requête mal formée
|
307
|
+
schema:
|
308
|
+
$ref: '#/definitions/Error'
|
309
|
+
404:
|
310
|
+
description: Région introuvable
|
311
|
+
schema:
|
312
|
+
$ref: '#/definitions/Error'
|
313
|
+
|
314
|
+
/regions/{code}/departements:
|
315
|
+
get:
|
316
|
+
summary: Renvoi les départements d'une région
|
317
|
+
tags:
|
318
|
+
- Départements
|
319
|
+
- Régions
|
320
|
+
parameters:
|
321
|
+
- name: code
|
322
|
+
in: path
|
323
|
+
description: Code de la région
|
324
|
+
required: true
|
325
|
+
type: string
|
326
|
+
- $ref: '#/parameters/regionFieldsParam'
|
327
|
+
responses:
|
328
|
+
200:
|
329
|
+
description: Liste des départements de la région
|
330
|
+
schema:
|
331
|
+
$ref: '#/definitions/Departement'
|
332
|
+
400:
|
333
|
+
description: Erreur. Requête mal formée
|
334
|
+
schema:
|
335
|
+
$ref: '#/definitions/Error'
|
336
|
+
404:
|
337
|
+
description: Département introuvable
|
338
|
+
schema:
|
339
|
+
$ref: '#/definitions/Error'
|
340
|
+
|
341
|
+
definitions:
|
342
|
+
Error:
|
343
|
+
type: object
|
344
|
+
properties:
|
345
|
+
code:
|
346
|
+
type: integer
|
347
|
+
description: Code HTTP de l'erreur
|
348
|
+
message:
|
349
|
+
type: string
|
350
|
+
description: Libellé de l'erreur
|
351
|
+
description:
|
352
|
+
type: string
|
353
|
+
description: Explication
|
354
|
+
Commune:
|
355
|
+
type: object
|
356
|
+
properties:
|
357
|
+
code:
|
358
|
+
type: string
|
359
|
+
description: Code INSEE de la commune
|
360
|
+
nom:
|
361
|
+
type: string
|
362
|
+
description: Nom de la commune
|
363
|
+
codesPostaux:
|
364
|
+
type: array
|
365
|
+
description: Liste des codes postaux associés à la commune
|
366
|
+
items:
|
367
|
+
type: string
|
368
|
+
codeDepartement:
|
369
|
+
type: string
|
370
|
+
description: Code du département associé à la commune
|
371
|
+
codeRegion:
|
372
|
+
type: string
|
373
|
+
description: Code de la région associée à la commune
|
374
|
+
departement:
|
375
|
+
$ref: '#/definitions/Departement'
|
376
|
+
region:
|
377
|
+
$ref: '#/definitions/Region'
|
378
|
+
population:
|
379
|
+
type: integer
|
380
|
+
description: Population municipale
|
381
|
+
surface:
|
382
|
+
type: number
|
383
|
+
format: float
|
384
|
+
description: Surface de la commune, en mètres-carrés
|
385
|
+
centre:
|
386
|
+
type: object
|
387
|
+
description: Centre de la commune (Point GeoJSON)
|
388
|
+
contour:
|
389
|
+
type: object
|
390
|
+
description: Contour de la commune (Polygon GeoJSON)
|
391
|
+
Departement:
|
392
|
+
type: object
|
393
|
+
properties:
|
394
|
+
code:
|
395
|
+
type: string
|
396
|
+
description: Code du département
|
397
|
+
nom:
|
398
|
+
type: string
|
399
|
+
description: Nom du département
|
400
|
+
codeRegion:
|
401
|
+
type: string
|
402
|
+
description: Code de la région
|
403
|
+
region:
|
404
|
+
$ref: '#/definitions/Region'
|
405
|
+
Region:
|
406
|
+
type: object
|
407
|
+
properties:
|
408
|
+
code:
|
409
|
+
type: string
|
410
|
+
description: Code de la région
|
411
|
+
nom:
|
412
|
+
type: string
|
413
|
+
description: Nom de la région
|