Skip to content

Commit 08b0753

Browse files
committed
Fix OAS 3.0 paths
1 parent 4ba68cf commit 08b0753

1 file changed

Lines changed: 84 additions & 62 deletions

File tree

openfisca_web_api/openAPI.yml

Lines changed: 84 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
openapi: "3.0.0"
2+
23
info:
34
title: "{COUNTRY_PACKAGE_NAME} Web API"
45
description: "The OpenFisca Web API lets you get up-to-date information and formulas included in the {COUNTRY_PACKAGE_NAME} legislation."
@@ -9,199 +10,220 @@ info:
910
license:
1011
name: "AGPL"
1112
url: "https://www.gnu.org/licenses/agpl-3.0"
12-
host: null
13-
schemes: null
13+
1414
tags:
1515
- name: "Parameters"
1616
description: "A parameter is a numeric property of the legislation that can evolve over time."
1717
externalDocs:
1818
description: "Parameters documentation"
1919
url: "https://openfisca.org/doc/key-concepts/parameters.html"
20+
2021
- name: "Variables"
2122
description: "A variable depends on a person, or an entity (e.g. zip code, salary, income tax)."
2223
externalDocs:
2324
description: "Variables documentation"
2425
url: "https://openfisca.org/doc/key-concepts/variables.html"
26+
2527
- name: "Entities"
2628
description: "An entity is a person of a group of individuals (such as a household)."
2729
externalDocs:
2830
description: "Entities documentation"
2931
url: "https://openfisca.org/doc/key-concepts/person,_entities,_role.html"
32+
3033
- name: "Calculations"
34+
3135
- name: "Documentation"
36+
3237
paths:
3338
/calculate:
3439
post:
3540
summary: "Run a simulation"
3641
tags:
3742
- Calculations
3843
operationId: "calculate"
39-
consumes:
40-
- "application/json"
41-
produces:
42-
- "application/json"
43-
parameters:
44-
- in: "body"
45-
name: "Situation"
44+
requestBody:
4645
description: "Describe the situation (persons and entities). Add the variable you wish to calculate in the proper entity, with null as the value. Learn more in our official documentation: https://openfisca.org/doc/openfisca-web-api/input-output-data.html"
4746
required: true
48-
schema:
49-
$ref: "#/definitions/SituationInput"
47+
content:
48+
application/json:
49+
schema:
50+
$ref: "#/definitions/SituationInput"
5051
responses:
5152
200:
5253
description: "The calculation result is sent back in the response body"
54+
content:
55+
application/json:
56+
schema:
57+
$ref: "#/definitions/SituationOutput"
5358
headers:
54-
$ref: "#/components/headers"
55-
schema:
56-
$ref: "#/definitions/SituationOutput"
59+
schema:
60+
$ref: "#/components/headers"
5761
404:
5862
description: "A variable mentioned in the input situation does not exist in the loaded tax and benefit system. Details are sent back in the response body"
5963
headers:
60-
$ref: "#/components/headers"
64+
schema:
65+
$ref: "#/components/headers"
6166
400:
6267
description: "The request is invalid. Details about the error are sent back in the response body"
6368
headers:
64-
$ref: "#/components/headers"
69+
schema:
70+
$ref: "#/components/headers"
71+
6572
/parameters:
6673
get:
6774
tags:
6875
- "Parameters"
6976
summary: "List all available parameters"
7077
operationId: "getParameters"
71-
produces:
72-
- "application/json"
7378
responses:
7479
200:
7580
description: "The list of parameters is sent back in the response body"
81+
content:
82+
application/json:
83+
schema:
84+
$ref: "#/definitions/Parameters"
7685
headers:
77-
$ref: "#/components/headers"
78-
schema:
79-
$ref: "#/definitions/Parameters"
86+
schema:
87+
$ref: "#/components/headers"
88+
8089
/parameter/{parameterID}:
8190
get:
8291
tags:
8392
- "Parameters"
8493
summary: "Get information about a specific parameter"
8594
operationId: "getParameter"
86-
produces:
87-
- "application/json"
8895
parameters:
8996
- name: "parameterID"
9097
in: "path"
9198
description: "ID of parameter. IDs can be obtained by enumerating the /parameters endpoint"
9299
required: true
93-
type: "string"
100+
schema:
101+
type: "string"
94102
responses:
95103
200:
96104
description: "The requested parameter's information is sent back in the response body"
105+
content:
106+
application/json:
107+
schema:
108+
$ref: "#/definitions/Parameter"
97109
headers:
98-
$ref: "#/components/headers"
99-
schema:
100-
$ref: "#/definitions/Parameter"
110+
schema:
111+
$ref: "#/components/headers"
101112
404:
102113
description: "The requested parameter does not exist"
103114
headers:
104-
$ref: "#/components/headers"
115+
schema:
116+
$ref: "#/components/headers"
117+
105118
/variables:
106119
get:
107120
tags:
108121
- "Variables"
109122
summary: "List all available variables"
110123
operationId: "getVariables"
111-
produces:
112-
- "application/json"
113124
responses:
114125
200:
115126
description: "The list of variables is sent back in the response body"
127+
content:
128+
application/json:
129+
schema:
130+
$ref: "#/definitions/Variables"
116131
headers:
117-
$ref: "#/components/headers"
118-
schema:
119-
$ref: "#/definitions/Variables"
132+
schema:
133+
$ref: "#/components/headers"
134+
120135
/variable/{variableID}:
121136
get:
122137
tags:
123138
- "Variables"
124139
summary: "Get information about a specific variable"
125140
operationId: "getVariable"
126-
produces:
127-
- "application/json"
128141
parameters:
129142
- name: "variableID"
130143
in: "path"
131144
description: "ID of a variable. IDs can be obtained by enumerating the /variables endpoint."
132145
required: true
133-
type: "string"
146+
schema:
147+
type: "string"
134148
responses:
135149
200:
136150
description: "The requested variable's information is sent back in the response body"
151+
content:
152+
application/json:
153+
schema:
154+
$ref: "#/definitions/Variable"
137155
headers:
138-
$ref: "#/components/headers"
139-
schema:
140-
$ref: "#/definitions/Variable"
156+
schema:
157+
$ref: "#/components/headers"
141158
404:
142159
description: "The requested variable does not exist"
143160
headers:
144-
$ref: "#/components/headers"
161+
schema:
162+
$ref: "#/components/headers"
163+
145164
/entities:
146165
get:
147166
tags:
148167
- "Entities"
149168
summary: "List all available Entities"
150169
operationId: "getVariables"
151-
produces:
152-
- "application/json"
153170
responses:
154171
200:
155172
description: "The list of the entities as well as their information is sent back in the response body"
173+
content:
174+
application/json:
175+
schema:
176+
$ref: "#/definitions/Entities"
156177
headers:
157-
$ref: "#/components/headers"
158-
schema:
159-
$ref: "#/definitions/Entities"
178+
schema:
179+
$ref: "#/components/headers"
180+
160181
/trace:
161182
post:
162183
summary: "Explore a simulation's steps in details."
163184
tags:
164185
- Calculations
165186
operationId: "trace"
166-
consumes:
167-
- "application/json"
168-
produces:
169-
- "application/json"
170-
parameters:
171-
- in: "body"
172-
name: "Situation"
187+
requestBody:
173188
description: "Describe the situation (persons and entities). Add the variable you wish to calculate in the proper entity, with null as the value."
174189
required: true
175-
schema:
176-
$ref: "#/definitions/SituationInput"
190+
content:
191+
application/json:
192+
schema:
193+
$ref: "#/definitions/SituationInput"
177194
responses:
178195
200:
179196
description: "The calculation details are sent back in the response body"
197+
content:
198+
application/json:
199+
schema:
200+
$ref: "#/definitions/Trace"
180201
headers:
181-
$ref: "#/components/headers"
182-
schema:
183-
$ref: "#/definitions/Trace"
202+
schema:
203+
$ref: "#/components/headers"
184204
404:
185205
description: "A variable mentioned in the input situation does not exist in the loaded tax and benefit system. Details are sent back in the response body"
186206
headers:
187-
$ref: "#/components/headers"
207+
schema:
208+
$ref: "#/components/headers"
188209
400:
189210
description: "The request is invalid. Details about the error are sent back in the response body"
190211
headers:
191-
$ref: "#/components/headers"
212+
schema:
213+
$ref: "#/components/headers"
214+
192215
/spec:
193216
get:
194217
summary: Provide the API documentation in an OpenAPI format
195218
tags:
196219
- Documentation
197220
operationId: spec
198-
produces:
199-
- application/json
200221
responses:
201222
200:
202223
description: The API documentation is sent back in the response body
203224
headers:
204-
$ref: "#/components/headers"
225+
schema:
226+
$ref: "#/components/headers"
205227

206228
definitions:
207229
Parameter:

0 commit comments

Comments
 (0)