@xyd-js/openapi 0.1.0-build.168

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +1517 -0
  2. package/LICENSE +21 -0
  3. package/README.md +3 -0
  4. package/__fixtures__/-2.complex.openai/input.yaml +39848 -0
  5. package/__fixtures__/-2.complex.openai/output.json +321646 -0
  6. package/__fixtures__/-2.complex.openai/pluginOasOpenai.ts +553 -0
  7. package/__fixtures__/-3.random/input.yaml +234 -0
  8. package/__fixtures__/-3.random/output.json +1140 -0
  9. package/__fixtures__/1.basic/input.yaml +226 -0
  10. package/__fixtures__/1.basic/output.json +1919 -0
  11. package/__fixtures__/2.more/input.yaml +76 -0
  12. package/__fixtures__/2.more/output.json +327 -0
  13. package/__fixtures__/3.multiple-responses/input.yaml +48 -0
  14. package/__fixtures__/3.multiple-responses/output.json +311 -0
  15. package/__fixtures__/5.xdocs.codeLanguages/input.yaml +231 -0
  16. package/__fixtures__/5.xdocs.codeLanguages/output.json +1879 -0
  17. package/__fixtures__/5.xdocs.sidebar/input.yaml +256 -0
  18. package/__fixtures__/5.xdocs.sidebar/output.json +843 -0
  19. package/__fixtures__/6.codeSamples/input.yaml +75 -0
  20. package/__fixtures__/6.codeSamples/output.json +293 -0
  21. package/__tests__/oapSchemaToReferences.test.ts +82 -0
  22. package/__tests__/utils.ts +81 -0
  23. package/dist/index.cjs +2154 -0
  24. package/dist/index.cjs.map +1 -0
  25. package/dist/index.d.cts +40 -0
  26. package/dist/index.d.ts +40 -0
  27. package/dist/index.js +2119 -0
  28. package/dist/index.js.map +1 -0
  29. package/examples/basic/index.ts +20 -0
  30. package/examples/basic/index2.ts +36 -0
  31. package/examples/basic/openapi.yaml +124 -0
  32. package/examples/dist/index.cjs +2 -0
  33. package/examples/dist/index.cjs.map +1 -0
  34. package/examples/dist/index.d.cts +2 -0
  35. package/examples/dist/index.d.ts +2 -0
  36. package/examples/dist/index.js +2 -0
  37. package/examples/dist/index.js.map +1 -0
  38. package/examples/semi/index.ts +16 -0
  39. package/examples/semi/openapi.yaml +365 -0
  40. package/examples/semi/references.json +500 -0
  41. package/examples/webhooks/index.ts +16 -0
  42. package/examples/webhooks/openapi.yaml +248 -0
  43. package/examples/webhooks/references.json +895 -0
  44. package/index.ts +12 -0
  45. package/package.json +31 -0
  46. package/src/const.ts +14 -0
  47. package/src/converters/oas-componentSchemas.ts +205 -0
  48. package/src/converters/oas-examples.ts +530 -0
  49. package/src/converters/oas-parameters.ts +41 -0
  50. package/src/converters/oas-paths.ts +354 -0
  51. package/src/converters/oas-requestBody.ts +57 -0
  52. package/src/converters/oas-responses.ts +76 -0
  53. package/src/converters/oas-schema.ts +141 -0
  54. package/src/index.ts +21 -0
  55. package/src/oas-core.ts +579 -0
  56. package/src/types.ts +18 -0
  57. package/src/utils.ts +157 -0
  58. package/src/xdocs/index.ts +18 -0
  59. package/src/xdocs/pluginSidebar.ts +580 -0
  60. package/src/xdocs/types.ts +26 -0
  61. package/tsconfig.json +18 -0
  62. package/tsup.config.ts +19 -0
  63. package/tsup.examples-config.ts +30 -0
  64. package/vitest.config.ts +7 -0
@@ -0,0 +1,843 @@
1
+ [
2
+ {
3
+ "title": "Returns a list of users",
4
+ "canonical": "/users/get",
5
+ "description": "Optional extended description in CommonMark or HTML.",
6
+ "type": "rest_get",
7
+ "category": "rest",
8
+ "context": {
9
+ "method": "get",
10
+ "path": "/users",
11
+ "fullPath": "http:/api.example.com/v1/users",
12
+ "group": [
13
+ "API & Reference",
14
+ "Endpoints",
15
+ "Users"
16
+ ],
17
+ "scopes": []
18
+ },
19
+ "examples": {
20
+ "groups": [
21
+ {
22
+ "description": "Example request",
23
+ "examples": [
24
+ {
25
+ "codeblock": {
26
+ "tabs": [
27
+ {
28
+ "title": "shell",
29
+ "language": "shell",
30
+ "code": "curl --request \\\n --url 'http://api.example.com/v1?limit=20&offset=0' \\\n --header 'accept: application/json'"
31
+ },
32
+ {
33
+ "title": "javascript",
34
+ "language": "javascript",
35
+ "code": "const options = {method: '', headers: {accept: 'application/json'}};\n\nfetch('http://api.example.com/v1?limit=20&offset=0', options)\n .then(res => res.json())\n .then(res => console.log(res))\n .catch(err => console.error(err));"
36
+ },
37
+ {
38
+ "title": "python",
39
+ "language": "python",
40
+ "code": "import requests\n\nurl = \"http://api.example.com/v1?limit=20&offset=0\"\n\nheaders = {\"accept\": \"application/json\"}\n\nresponse = requests.request(\"\", url, headers=headers)\n\nprint(response.text)"
41
+ },
42
+ {
43
+ "title": "go",
44
+ "language": "go",
45
+ "code": "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io\"\n)\n\nfunc main() {\n\n\turl := \"http://api.example.com/v1?limit=20&offset=0\"\n\n\treq, _ := http.NewRequest(\"\", url, nil)\n\n\treq.Header.Add(\"accept\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := io.ReadAll(res.Body)\n\n\tfmt.Println(string(body))\n\n}"
46
+ }
47
+ ]
48
+ }
49
+ }
50
+ ]
51
+ },
52
+ {
53
+ "description": "Example response",
54
+ "examples": [
55
+ {
56
+ "codeblock": {
57
+ "title": "200",
58
+ "tabs": [
59
+ {
60
+ "title": "application/json",
61
+ "language": "json",
62
+ "code": "[\n {\n \"id\": 0,\n \"username\": \"string\",\n \"email\": \"user@example.com\",\n \"status\": \"active\",\n \"createdAt\": \"2019-08-24T14:15:22Z\",\n \"updatedAt\": \"2019-08-24T14:15:22Z\"\n }\n]"
63
+ }
64
+ ]
65
+ }
66
+ }
67
+ ]
68
+ }
69
+ ]
70
+ },
71
+ "definitions": [
72
+ {
73
+ "title": "Query parameters",
74
+ "properties": [
75
+ {
76
+ "name": "limit",
77
+ "type": "integer",
78
+ "description": "Maximum number of items to return",
79
+ "meta": [
80
+ {
81
+ "name": "defaults",
82
+ "value": 20
83
+ },
84
+ {
85
+ "name": "required",
86
+ "value": "true"
87
+ }
88
+ ]
89
+ },
90
+ {
91
+ "name": "offset",
92
+ "type": "integer",
93
+ "description": "Number of items to skip",
94
+ "meta": [
95
+ {
96
+ "name": "defaults",
97
+ "value": 0
98
+ }
99
+ ]
100
+ }
101
+ ]
102
+ },
103
+ {
104
+ "title": "Response",
105
+ "variants": [
106
+ {
107
+ "title": "200",
108
+ "description": "A JSON array of users",
109
+ "properties": [],
110
+ "rootProperty": {
111
+ "type": "$$array",
112
+ "properties": [
113
+ {
114
+ "name": "id",
115
+ "type": "integer",
116
+ "description": "",
117
+ "meta": [
118
+ {
119
+ "name": "required",
120
+ "value": "true"
121
+ }
122
+ ]
123
+ },
124
+ {
125
+ "name": "username",
126
+ "type": "string",
127
+ "description": "",
128
+ "meta": [
129
+ {
130
+ "name": "required",
131
+ "value": "true"
132
+ }
133
+ ]
134
+ },
135
+ {
136
+ "name": "email",
137
+ "type": "string",
138
+ "description": "",
139
+ "meta": []
140
+ },
141
+ {
142
+ "name": "status",
143
+ "type": "$$enum",
144
+ "description": "",
145
+ "meta": [
146
+ {
147
+ "name": "enum-type",
148
+ "value": "string"
149
+ }
150
+ ],
151
+ "properties": [
152
+ {
153
+ "name": "active",
154
+ "type": "string",
155
+ "description": "",
156
+ "meta": []
157
+ },
158
+ {
159
+ "name": "inactive",
160
+ "type": "string",
161
+ "description": "",
162
+ "meta": []
163
+ }
164
+ ]
165
+ },
166
+ {
167
+ "name": "createdAt",
168
+ "type": "string",
169
+ "description": "",
170
+ "meta": []
171
+ },
172
+ {
173
+ "name": "updatedAt",
174
+ "type": "string",
175
+ "description": "",
176
+ "meta": []
177
+ }
178
+ ]
179
+ },
180
+ "meta": [
181
+ {
182
+ "name": "status",
183
+ "value": "200"
184
+ },
185
+ {
186
+ "name": "contentType",
187
+ "value": "application/json"
188
+ },
189
+ {
190
+ "name": "definitionDescription",
191
+ "value": ""
192
+ }
193
+ ]
194
+ }
195
+ ],
196
+ "properties": []
197
+ }
198
+ ]
199
+ },
200
+ {
201
+ "title": "Get user by ID",
202
+ "canonical": "/users/userId",
203
+ "description": "Get user by ID",
204
+ "type": "rest_get",
205
+ "category": "rest",
206
+ "context": {
207
+ "method": "get",
208
+ "path": "/users/{userId}",
209
+ "fullPath": "http:/api.example.com/v1/users/{userId}",
210
+ "group": [
211
+ "API & Reference",
212
+ "Endpoints",
213
+ "Users"
214
+ ],
215
+ "scopes": []
216
+ },
217
+ "examples": {
218
+ "groups": [
219
+ {
220
+ "description": "Example request",
221
+ "examples": [
222
+ {
223
+ "codeblock": {
224
+ "tabs": [
225
+ {
226
+ "title": "shell",
227
+ "language": "shell",
228
+ "code": "curl --request \\\n --url http://api.example.com/v1 \\\n --header 'accept: application/json'"
229
+ },
230
+ {
231
+ "title": "javascript",
232
+ "language": "javascript",
233
+ "code": "const options = {method: '', headers: {accept: 'application/json'}};\n\nfetch('http://api.example.com/v1', options)\n .then(res => res.json())\n .then(res => console.log(res))\n .catch(err => console.error(err));"
234
+ },
235
+ {
236
+ "title": "python",
237
+ "language": "python",
238
+ "code": "import requests\n\nurl = \"http://api.example.com/v1\"\n\nheaders = {\"accept\": \"application/json\"}\n\nresponse = requests.request(\"\", url, headers=headers)\n\nprint(response.text)"
239
+ },
240
+ {
241
+ "title": "go",
242
+ "language": "go",
243
+ "code": "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io\"\n)\n\nfunc main() {\n\n\turl := \"http://api.example.com/v1\"\n\n\treq, _ := http.NewRequest(\"\", url, nil)\n\n\treq.Header.Add(\"accept\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := io.ReadAll(res.Body)\n\n\tfmt.Println(string(body))\n\n}"
244
+ }
245
+ ]
246
+ }
247
+ }
248
+ ]
249
+ },
250
+ {
251
+ "description": "Example response",
252
+ "examples": [
253
+ {
254
+ "codeblock": {
255
+ "title": "200",
256
+ "tabs": [
257
+ {
258
+ "title": "application/json",
259
+ "language": "json",
260
+ "code": "{\n \"id\": 0,\n \"username\": \"string\",\n \"email\": \"user@example.com\",\n \"status\": \"active\",\n \"createdAt\": \"2019-08-24T14:15:22Z\",\n \"updatedAt\": \"2019-08-24T14:15:22Z\"\n}"
261
+ }
262
+ ]
263
+ }
264
+ }
265
+ ]
266
+ }
267
+ ]
268
+ },
269
+ "definitions": [
270
+ {
271
+ "title": "Response",
272
+ "variants": [
273
+ {
274
+ "title": "200",
275
+ "description": "User details",
276
+ "properties": [
277
+ {
278
+ "name": "id",
279
+ "type": "integer",
280
+ "description": "",
281
+ "meta": [
282
+ {
283
+ "name": "required",
284
+ "value": "true"
285
+ }
286
+ ]
287
+ },
288
+ {
289
+ "name": "username",
290
+ "type": "string",
291
+ "description": "",
292
+ "meta": [
293
+ {
294
+ "name": "required",
295
+ "value": "true"
296
+ }
297
+ ]
298
+ },
299
+ {
300
+ "name": "email",
301
+ "type": "string",
302
+ "description": "",
303
+ "meta": []
304
+ },
305
+ {
306
+ "name": "status",
307
+ "type": "$$enum",
308
+ "description": "",
309
+ "meta": [
310
+ {
311
+ "name": "enum-type",
312
+ "value": "string"
313
+ }
314
+ ],
315
+ "properties": [
316
+ {
317
+ "name": "active",
318
+ "type": "string",
319
+ "description": "",
320
+ "meta": []
321
+ },
322
+ {
323
+ "name": "inactive",
324
+ "type": "string",
325
+ "description": "",
326
+ "meta": []
327
+ }
328
+ ]
329
+ },
330
+ {
331
+ "name": "createdAt",
332
+ "type": "string",
333
+ "description": "",
334
+ "meta": []
335
+ },
336
+ {
337
+ "name": "updatedAt",
338
+ "type": "string",
339
+ "description": "",
340
+ "meta": []
341
+ }
342
+ ],
343
+ "meta": [
344
+ {
345
+ "name": "status",
346
+ "value": "200"
347
+ },
348
+ {
349
+ "name": "contentType",
350
+ "value": "application/json"
351
+ },
352
+ {
353
+ "name": "definitionDescription",
354
+ "value": ""
355
+ }
356
+ ]
357
+ },
358
+ {
359
+ "title": "404",
360
+ "description": "User not found",
361
+ "properties": [],
362
+ "meta": [
363
+ {
364
+ "name": "status",
365
+ "value": "404"
366
+ }
367
+ ]
368
+ }
369
+ ],
370
+ "properties": []
371
+ }
372
+ ]
373
+ },
374
+ {
375
+ "title": "Get user's posts",
376
+ "canonical": "/users/posts",
377
+ "description": "Get user's posts",
378
+ "type": "rest_get",
379
+ "category": "rest",
380
+ "context": {
381
+ "method": "get",
382
+ "path": "/users/{userId}/posts",
383
+ "fullPath": "http:/api.example.com/v1/users/{userId}/posts",
384
+ "group": [
385
+ "API & Reference",
386
+ "Endpoints",
387
+ "Users"
388
+ ],
389
+ "scopes": []
390
+ },
391
+ "examples": {
392
+ "groups": [
393
+ {
394
+ "description": "Example request",
395
+ "examples": [
396
+ {
397
+ "codeblock": {
398
+ "tabs": [
399
+ {
400
+ "title": "shell",
401
+ "language": "shell",
402
+ "code": "curl --request \\\n --url http://api.example.com/v1 \\\n --header 'accept: application/json'"
403
+ },
404
+ {
405
+ "title": "javascript",
406
+ "language": "javascript",
407
+ "code": "const options = {method: '', headers: {accept: 'application/json'}};\n\nfetch('http://api.example.com/v1', options)\n .then(res => res.json())\n .then(res => console.log(res))\n .catch(err => console.error(err));"
408
+ },
409
+ {
410
+ "title": "python",
411
+ "language": "python",
412
+ "code": "import requests\n\nurl = \"http://api.example.com/v1\"\n\nheaders = {\"accept\": \"application/json\"}\n\nresponse = requests.request(\"\", url, headers=headers)\n\nprint(response.text)"
413
+ },
414
+ {
415
+ "title": "go",
416
+ "language": "go",
417
+ "code": "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io\"\n)\n\nfunc main() {\n\n\turl := \"http://api.example.com/v1\"\n\n\treq, _ := http.NewRequest(\"\", url, nil)\n\n\treq.Header.Add(\"accept\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := io.ReadAll(res.Body)\n\n\tfmt.Println(string(body))\n\n}"
418
+ }
419
+ ]
420
+ }
421
+ }
422
+ ]
423
+ },
424
+ {
425
+ "description": "Example response",
426
+ "examples": [
427
+ {
428
+ "codeblock": {
429
+ "title": "200",
430
+ "tabs": [
431
+ {
432
+ "title": "application/json",
433
+ "language": "json",
434
+ "code": "[\n {\n \"id\": 0,\n \"title\": \"string\",\n \"content\": \"string\",\n \"userId\": 0,\n \"createdAt\": \"2019-08-24T14:15:22Z\",\n \"updatedAt\": \"2019-08-24T14:15:22Z\"\n }\n]"
435
+ }
436
+ ]
437
+ }
438
+ }
439
+ ]
440
+ }
441
+ ]
442
+ },
443
+ "definitions": [
444
+ {
445
+ "title": "Response",
446
+ "variants": [
447
+ {
448
+ "title": "200",
449
+ "description": "List of user's posts",
450
+ "properties": [],
451
+ "rootProperty": {
452
+ "type": "$$array",
453
+ "properties": [
454
+ {
455
+ "name": "id",
456
+ "type": "integer",
457
+ "description": "",
458
+ "meta": [
459
+ {
460
+ "name": "required",
461
+ "value": "true"
462
+ }
463
+ ]
464
+ },
465
+ {
466
+ "name": "title",
467
+ "type": "string",
468
+ "description": "",
469
+ "meta": [
470
+ {
471
+ "name": "required",
472
+ "value": "true"
473
+ }
474
+ ]
475
+ },
476
+ {
477
+ "name": "content",
478
+ "type": "string",
479
+ "description": "",
480
+ "meta": [
481
+ {
482
+ "name": "required",
483
+ "value": "true"
484
+ }
485
+ ]
486
+ },
487
+ {
488
+ "name": "userId",
489
+ "type": "integer",
490
+ "description": "",
491
+ "meta": [
492
+ {
493
+ "name": "required",
494
+ "value": "true"
495
+ }
496
+ ]
497
+ },
498
+ {
499
+ "name": "createdAt",
500
+ "type": "string",
501
+ "description": "",
502
+ "meta": []
503
+ },
504
+ {
505
+ "name": "updatedAt",
506
+ "type": "string",
507
+ "description": "",
508
+ "meta": []
509
+ }
510
+ ]
511
+ },
512
+ "meta": [
513
+ {
514
+ "name": "status",
515
+ "value": "200"
516
+ },
517
+ {
518
+ "name": "contentType",
519
+ "value": "application/json"
520
+ },
521
+ {
522
+ "name": "definitionDescription",
523
+ "value": ""
524
+ }
525
+ ]
526
+ }
527
+ ],
528
+ "properties": []
529
+ }
530
+ ]
531
+ },
532
+ {
533
+ "title": "Create a new post for user",
534
+ "canonical": "/users/posts/create",
535
+ "description": "Create a new post for user",
536
+ "type": "rest_post",
537
+ "category": "rest",
538
+ "context": {
539
+ "method": "post",
540
+ "path": "/users/{userId}/posts",
541
+ "fullPath": "http:/api.example.com/v1/users/{userId}/posts",
542
+ "group": [
543
+ "API & Reference",
544
+ "Endpoints",
545
+ "Users"
546
+ ],
547
+ "scopes": []
548
+ },
549
+ "examples": {
550
+ "groups": [
551
+ {
552
+ "description": "Example request",
553
+ "examples": [
554
+ {
555
+ "codeblock": {
556
+ "tabs": [
557
+ {
558
+ "title": "shell",
559
+ "language": "shell",
560
+ "code": "curl --request \\\n --url http://api.example.com/v1 \\\n --header 'accept: application/json' \\\n --header 'content-type: application/json' \\\n --data '\n{\n \"title\": \"string\",\n \"content\": \"string\"\n}\n'"
561
+ },
562
+ {
563
+ "title": "javascript",
564
+ "language": "javascript",
565
+ "code": "const options = {\n method: '',\n headers: {accept: 'application/json', 'content-type': 'application/json'},\n body: JSON.stringify({title: 'string', content: 'string'})\n};\n\nfetch('http://api.example.com/v1', options)\n .then(res => res.json())\n .then(res => console.log(res))\n .catch(err => console.error(err));"
566
+ },
567
+ {
568
+ "title": "python",
569
+ "language": "python",
570
+ "code": "import requests\n\nurl = \"http://api.example.com/v1\"\n\npayload = {\n \"title\": \"string\",\n \"content\": \"string\"\n}\nheaders = {\n \"accept\": \"application/json\",\n \"content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\", url, json=payload, headers=headers)\n\nprint(response.text)"
571
+ },
572
+ {
573
+ "title": "go",
574
+ "language": "go",
575
+ "code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io\"\n)\n\nfunc main() {\n\n\turl := \"http://api.example.com/v1\"\n\n\tpayload := strings.NewReader(\"{\\\"title\\\":\\\"string\\\",\\\"content\\\":\\\"string\\\"}\")\n\n\treq, _ := http.NewRequest(\"\", url, payload)\n\n\treq.Header.Add(\"accept\", \"application/json\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := io.ReadAll(res.Body)\n\n\tfmt.Println(string(body))\n\n}"
576
+ }
577
+ ]
578
+ }
579
+ }
580
+ ]
581
+ },
582
+ {
583
+ "description": "Example response",
584
+ "examples": [
585
+ {
586
+ "codeblock": {
587
+ "title": "201",
588
+ "tabs": [
589
+ {
590
+ "title": "application/json",
591
+ "language": "json",
592
+ "code": "{\n \"id\": 0,\n \"title\": \"string\",\n \"content\": \"string\",\n \"userId\": 0,\n \"createdAt\": \"2019-08-24T14:15:22Z\",\n \"updatedAt\": \"2019-08-24T14:15:22Z\"\n}"
593
+ }
594
+ ]
595
+ }
596
+ }
597
+ ]
598
+ }
599
+ ]
600
+ },
601
+ "definitions": [
602
+ {
603
+ "title": "Request body",
604
+ "variants": [
605
+ {
606
+ "title": "application/json",
607
+ "description": "",
608
+ "properties": [
609
+ {
610
+ "name": "title",
611
+ "type": "string",
612
+ "description": "",
613
+ "meta": [
614
+ {
615
+ "name": "required",
616
+ "value": "true"
617
+ }
618
+ ]
619
+ },
620
+ {
621
+ "name": "content",
622
+ "type": "string",
623
+ "description": "",
624
+ "meta": [
625
+ {
626
+ "name": "required",
627
+ "value": "true"
628
+ }
629
+ ]
630
+ }
631
+ ],
632
+ "meta": [
633
+ {
634
+ "name": "contentType",
635
+ "value": "application/json"
636
+ },
637
+ {
638
+ "name": "required",
639
+ "value": "true"
640
+ }
641
+ ]
642
+ }
643
+ ],
644
+ "properties": [],
645
+ "meta": [
646
+ {
647
+ "name": "required",
648
+ "value": "true"
649
+ }
650
+ ]
651
+ },
652
+ {
653
+ "title": "Response",
654
+ "variants": [
655
+ {
656
+ "title": "201",
657
+ "description": "Post created successfully",
658
+ "properties": [
659
+ {
660
+ "name": "id",
661
+ "type": "integer",
662
+ "description": "",
663
+ "meta": [
664
+ {
665
+ "name": "required",
666
+ "value": "true"
667
+ }
668
+ ]
669
+ },
670
+ {
671
+ "name": "title",
672
+ "type": "string",
673
+ "description": "",
674
+ "meta": [
675
+ {
676
+ "name": "required",
677
+ "value": "true"
678
+ }
679
+ ]
680
+ },
681
+ {
682
+ "name": "content",
683
+ "type": "string",
684
+ "description": "",
685
+ "meta": [
686
+ {
687
+ "name": "required",
688
+ "value": "true"
689
+ }
690
+ ]
691
+ },
692
+ {
693
+ "name": "userId",
694
+ "type": "integer",
695
+ "description": "",
696
+ "meta": [
697
+ {
698
+ "name": "required",
699
+ "value": "true"
700
+ }
701
+ ]
702
+ },
703
+ {
704
+ "name": "createdAt",
705
+ "type": "string",
706
+ "description": "",
707
+ "meta": []
708
+ },
709
+ {
710
+ "name": "updatedAt",
711
+ "type": "string",
712
+ "description": "",
713
+ "meta": []
714
+ }
715
+ ],
716
+ "meta": [
717
+ {
718
+ "name": "status",
719
+ "value": "201"
720
+ },
721
+ {
722
+ "name": "contentType",
723
+ "value": "application/json"
724
+ },
725
+ {
726
+ "name": "definitionDescription",
727
+ "value": ""
728
+ }
729
+ ]
730
+ }
731
+ ],
732
+ "properties": []
733
+ }
734
+ ]
735
+ },
736
+ {
737
+ "title": "User",
738
+ "description": "",
739
+ "canonical": "/users/object",
740
+ "definitions": [
741
+ {
742
+ "title": "User",
743
+ "properties": [
744
+ {
745
+ "name": "id",
746
+ "type": "integer",
747
+ "description": "",
748
+ "meta": [
749
+ {
750
+ "name": "required",
751
+ "value": "true"
752
+ }
753
+ ]
754
+ },
755
+ {
756
+ "name": "username",
757
+ "type": "string",
758
+ "description": "",
759
+ "meta": [
760
+ {
761
+ "name": "required",
762
+ "value": "true"
763
+ }
764
+ ]
765
+ },
766
+ {
767
+ "name": "email",
768
+ "type": "string",
769
+ "description": "",
770
+ "meta": []
771
+ },
772
+ {
773
+ "name": "status",
774
+ "type": "$$enum",
775
+ "description": "",
776
+ "meta": [
777
+ {
778
+ "name": "enum-type",
779
+ "value": "string"
780
+ }
781
+ ],
782
+ "properties": [
783
+ {
784
+ "name": "active",
785
+ "type": "string",
786
+ "description": "",
787
+ "meta": []
788
+ },
789
+ {
790
+ "name": "inactive",
791
+ "type": "string",
792
+ "description": "",
793
+ "meta": []
794
+ }
795
+ ]
796
+ },
797
+ {
798
+ "name": "createdAt",
799
+ "type": "string",
800
+ "description": "",
801
+ "meta": []
802
+ },
803
+ {
804
+ "name": "updatedAt",
805
+ "type": "string",
806
+ "description": "",
807
+ "meta": []
808
+ }
809
+ ],
810
+ "meta": []
811
+ }
812
+ ],
813
+ "examples": {
814
+ "groups": [
815
+ {
816
+ "description": "Example",
817
+ "examples": [
818
+ {
819
+ "codeblock": {
820
+ "tabs": [
821
+ {
822
+ "title": "json",
823
+ "language": "json",
824
+ "code": "{\n \"id\": 0,\n \"username\": \"\",\n \"email\": \"\",\n \"status\": \"\",\n \"createdAt\": \"\",\n \"updatedAt\": \"\"\n}"
825
+ }
826
+ ]
827
+ }
828
+ }
829
+ ]
830
+ }
831
+ ]
832
+ },
833
+ "type": "rest_component_schema",
834
+ "context": {
835
+ "componentSchema": "User",
836
+ "group": [
837
+ "API & Reference",
838
+ "Endpoints",
839
+ "Users"
840
+ ]
841
+ }
842
+ }
843
+ ]