Skip to content

Commit 9523265

Browse files
authored
Update README.md
1 parent 92812fc commit 9523265

File tree

1 file changed

+309
-0
lines changed

1 file changed

+309
-0
lines changed

README.md

Lines changed: 309 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,315 @@ data class StringResponse(val str: String)
6464
data class StringUsable(val str: String)
6565
```
6666

67+
Creates this openapi.json description:
68+
69+
```json
70+
{
71+
"info":{
72+
"title":"Test API",
73+
"version":"0.0.1",
74+
"description":"The Test API",
75+
"termsOfService":null,
76+
"contact":{
77+
"name":"Support",
78+
"url":null,
79+
"email":"support@test.com"
80+
},
81+
"license":null
82+
},
83+
"openapi":"3.0.0",
84+
"servers":[
85+
{
86+
"url":"http://localhost:8080/",
87+
"description":"Test server",
88+
"variables":null
89+
}
90+
],
91+
"paths":{
92+
"/string/{a}":{
93+
"get":{
94+
"tags":null,
95+
"summary":null,
96+
"description":null,
97+
"externalDocs":null,
98+
"operationId":null,
99+
"parameters":null,
100+
"requestBody":null,
101+
"responses":{
102+
"200":{
103+
"description":"OK",
104+
"headers":{
105+
106+
},
107+
"content":{
108+
"application/json":{
109+
"schema":{
110+
"$ref":"#/components/schemas/StringParam"
111+
},
112+
"example":null,
113+
"examples":null
114+
}
115+
}
116+
}
117+
},
118+
"deprecated":null,
119+
"security":null,
120+
"servers":null
121+
},
122+
"parameters":[
123+
{
124+
"name":"a",
125+
"in":"path",
126+
"required":true,
127+
"description":"A simple String Param",
128+
"deprecated":false,
129+
"allowEmptyValue":null,
130+
"schema":{
131+
"type":"string",
132+
"format":null,
133+
"nullable":false,
134+
"minimum":null,
135+
"maximum":null,
136+
"example":null
137+
},
138+
"example":null,
139+
"examples":null
140+
},
141+
{
142+
"name":"optional",
143+
"in":"query",
144+
"required":false,
145+
"description":"Optional String",
146+
"deprecated":false,
147+
"allowEmptyValue":false,
148+
"schema":{
149+
"type":"string",
150+
"format":null,
151+
"nullable":true,
152+
"minimum":null,
153+
"maximum":null,
154+
"example":null
155+
},
156+
"example":null,
157+
"examples":null
158+
}
159+
]
160+
},
161+
"/inine/string/{a}":{
162+
"get":{
163+
"tags":null,
164+
"summary":"String Param Endpoint",
165+
"description":"This is a String Param Endpoint",
166+
"externalDocs":null,
167+
"operationId":null,
168+
"parameters":null,
169+
"requestBody":null,
170+
"responses":{
171+
"200":{
172+
"description":"A String Response",
173+
"headers":{
174+
175+
},
176+
"content":{
177+
"application/json":{
178+
"schema":{
179+
"$ref":"#/components/schemas/StringResponse"
180+
},
181+
"example":{
182+
"str":"Hi"
183+
},
184+
"examples":null
185+
}
186+
}
187+
}
188+
},
189+
"deprecated":null,
190+
"security":null,
191+
"servers":null
192+
},
193+
"parameters":[
194+
{
195+
"name":"a",
196+
"in":"path",
197+
"required":true,
198+
"description":"A simple String Param",
199+
"deprecated":false,
200+
"allowEmptyValue":null,
201+
"schema":{
202+
"type":"string",
203+
"format":null,
204+
"nullable":false,
205+
"minimum":null,
206+
"maximum":null,
207+
"example":null
208+
},
209+
"example":null,
210+
"examples":null
211+
},
212+
{
213+
"name":"optional",
214+
"in":"query",
215+
"required":false,
216+
"description":"Optional String",
217+
"deprecated":false,
218+
"allowEmptyValue":false,
219+
"schema":{
220+
"type":"string",
221+
"format":null,
222+
"nullable":true,
223+
"minimum":null,
224+
"maximum":null,
225+
"example":null
226+
},
227+
"example":null,
228+
"examples":null
229+
}
230+
]
231+
},
232+
"/block":{
233+
"post":{
234+
"tags":null,
235+
"summary":"String Post Endpoint",
236+
"description":"This is a String Post Endpoint",
237+
"externalDocs":null,
238+
"operationId":null,
239+
"parameters":null,
240+
"requestBody":{
241+
"content":{
242+
"application/json":{
243+
"schema":{
244+
"$ref":"#/components/schemas/StringUsable"
245+
},
246+
"example":{
247+
"str":"Ho"
248+
},
249+
"examples":null
250+
}
251+
},
252+
"description":"A String Request",
253+
"required":null
254+
},
255+
"responses":{
256+
"200":{
257+
"description":"A String Response",
258+
"headers":{
259+
260+
},
261+
"content":{
262+
"application/json":{
263+
"schema":{
264+
"$ref":"#/components/schemas/StringUsable"
265+
},
266+
"example":{
267+
"str":"Ho"
268+
},
269+
"examples":null
270+
}
271+
}
272+
}
273+
},
274+
"deprecated":null,
275+
"security":null,
276+
"servers":null
277+
},
278+
"parameters":[
279+
280+
]
281+
}
282+
},
283+
"components":{
284+
"schemas":{
285+
"StringParam":{
286+
"properties":{
287+
"a":{
288+
"type":"string",
289+
"format":null,
290+
"nullable":false,
291+
"minimum":null,
292+
"maximum":null,
293+
"example":null
294+
},
295+
"optional":{
296+
"type":"string",
297+
"format":null,
298+
"nullable":true,
299+
"minimum":null,
300+
"maximum":null,
301+
"example":null
302+
}
303+
},
304+
"required":[
305+
"a"
306+
],
307+
"nullable":false,
308+
"example":null,
309+
"type":"object"
310+
},
311+
"StringResponse":{
312+
"properties":{
313+
"str":{
314+
"type":"string",
315+
"format":null,
316+
"nullable":false,
317+
"minimum":null,
318+
"maximum":null,
319+
"example":null
320+
}
321+
},
322+
"required":[
323+
"str"
324+
],
325+
"nullable":false,
326+
"example":null,
327+
"type":"object"
328+
},
329+
"StringUsable":{
330+
"properties":{
331+
"str":{
332+
"type":"string",
333+
"format":null,
334+
"nullable":false,
335+
"minimum":null,
336+
"maximum":null,
337+
"example":null
338+
}
339+
},
340+
"required":[
341+
"str"
342+
],
343+
"nullable":false,
344+
"example":null,
345+
"type":"object"
346+
}
347+
},
348+
"responses":{
349+
350+
},
351+
"parameters":{
352+
353+
},
354+
"examples":{
355+
356+
},
357+
"requestBodies":{
358+
359+
},
360+
"headers":{
361+
362+
},
363+
"securitySchemes":{
364+
365+
}
366+
},
367+
"security":[
368+
369+
],
370+
"tags":[
371+
372+
],
373+
"externalDocs":null
374+
}
375+
```
67376

68377
Full Example:
69378

0 commit comments

Comments
 (0)