@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,1140 @@
1
+ [
2
+ {
3
+ "title": "Get a book by title",
4
+ "canonical": "getBookByTitle",
5
+ "description": "Retrieve a book by its title",
6
+ "type": "rest_get",
7
+ "category": "rest",
8
+ "context": {
9
+ "method": "get",
10
+ "path": "/books",
11
+ "fullPath": "https:/api.example.com/v1/books",
12
+ "group": [
13
+ ""
14
+ ],
15
+ "scopes": []
16
+ },
17
+ "examples": {
18
+ "groups": [
19
+ {
20
+ "description": "Example request",
21
+ "examples": [
22
+ {
23
+ "codeblock": {
24
+ "title": "List all users",
25
+ "tabs": [
26
+ {
27
+ "title": "bash",
28
+ "language": "bash",
29
+ "code": "curl -X GET https://api.example.com/users\n"
30
+ },
31
+ {
32
+ "title": "javascript",
33
+ "language": "javascript",
34
+ "code": "const api = require('api-client');\napi.users.list();\n"
35
+ }
36
+ ]
37
+ }
38
+ },
39
+ {
40
+ "codeblock": {
41
+ "title": "Get user by ID",
42
+ "tabs": [
43
+ {
44
+ "title": "bash",
45
+ "language": "bash",
46
+ "code": "curl -X GET https://api.example.com/users/123\n"
47
+ },
48
+ {
49
+ "title": "javascript",
50
+ "language": "javascript",
51
+ "code": "const api = require('api-client');\napi.users.get('123');\n"
52
+ }
53
+ ]
54
+ }
55
+ }
56
+ ]
57
+ },
58
+ {
59
+ "description": "Example response",
60
+ "examples": [
61
+ {
62
+ "codeblock": {
63
+ "title": "200",
64
+ "tabs": [
65
+ {
66
+ "title": "application/json",
67
+ "language": "json",
68
+ "code": "{\n \"title\": \"The Great Gatsby\",\n \"author_name\": \"F. Scott Fitzgerald\",\n \"info\": {\n \"date\": \"1925-04-10\"\n }\n}"
69
+ }
70
+ ]
71
+ }
72
+ },
73
+ {
74
+ "codeblock": {
75
+ "title": "400",
76
+ "tabs": [
77
+ {
78
+ "title": "application/json",
79
+ "language": "json",
80
+ "code": "{\n \"message\": \"Book not found\",\n \"code\": \"BOOK_NOT_FOUND\"\n}"
81
+ }
82
+ ]
83
+ }
84
+ },
85
+ {
86
+ "codeblock": {
87
+ "title": "404",
88
+ "tabs": [
89
+ {
90
+ "title": "application/json",
91
+ "language": "json",
92
+ "code": "{\n \"message\": \"Book not found\",\n \"code\": \"BOOK_NOT_FOUND\"\n}"
93
+ }
94
+ ]
95
+ }
96
+ }
97
+ ]
98
+ }
99
+ ]
100
+ },
101
+ "definitions": [
102
+ {
103
+ "title": "Query parameters",
104
+ "properties": [
105
+ {
106
+ "name": "title",
107
+ "type": "string",
108
+ "description": "The title of the book",
109
+ "meta": [
110
+ {
111
+ "name": "required",
112
+ "value": "true"
113
+ }
114
+ ]
115
+ },
116
+ {
117
+ "name": "date",
118
+ "type": "string",
119
+ "description": "The date of the book",
120
+ "meta": []
121
+ }
122
+ ]
123
+ },
124
+ {
125
+ "title": "Response",
126
+ "variants": [
127
+ {
128
+ "title": "200",
129
+ "description": "Book found successfully",
130
+ "properties": [
131
+ {
132
+ "name": "title",
133
+ "type": "string",
134
+ "description": "The title of the book",
135
+ "meta": [
136
+ {
137
+ "name": "required",
138
+ "value": "true"
139
+ }
140
+ ]
141
+ },
142
+ {
143
+ "name": "author_name",
144
+ "type": "string",
145
+ "description": "The author of the book",
146
+ "meta": [
147
+ {
148
+ "name": "required",
149
+ "value": "true"
150
+ }
151
+ ]
152
+ },
153
+ {
154
+ "name": "info",
155
+ "type": "object",
156
+ "description": "",
157
+ "meta": [
158
+ {
159
+ "name": "required",
160
+ "value": "true"
161
+ },
162
+ {
163
+ "name": "example",
164
+ "value": "{\"date\":\"1925-04-10\"}"
165
+ }
166
+ ],
167
+ "properties": [
168
+ {
169
+ "name": "date",
170
+ "type": "string",
171
+ "description": "The date of the book",
172
+ "meta": [
173
+ {
174
+ "name": "required",
175
+ "value": "true"
176
+ }
177
+ ]
178
+ }
179
+ ]
180
+ }
181
+ ],
182
+ "meta": [
183
+ {
184
+ "name": "status",
185
+ "value": "200"
186
+ },
187
+ {
188
+ "name": "contentType",
189
+ "value": "application/json"
190
+ },
191
+ {
192
+ "name": "definitionDescription",
193
+ "value": ""
194
+ }
195
+ ]
196
+ },
197
+ {
198
+ "title": "400",
199
+ "description": "Bad request",
200
+ "properties": [
201
+ {
202
+ "name": "message",
203
+ "type": "string",
204
+ "description": "Error message",
205
+ "meta": [
206
+ {
207
+ "name": "required",
208
+ "value": "true"
209
+ }
210
+ ]
211
+ },
212
+ {
213
+ "name": "code",
214
+ "type": "string",
215
+ "description": "Error code",
216
+ "meta": []
217
+ }
218
+ ],
219
+ "meta": [
220
+ {
221
+ "name": "status",
222
+ "value": "400"
223
+ },
224
+ {
225
+ "name": "contentType",
226
+ "value": "application/json"
227
+ },
228
+ {
229
+ "name": "definitionDescription",
230
+ "value": ""
231
+ }
232
+ ]
233
+ },
234
+ {
235
+ "title": "404",
236
+ "description": "Book not found",
237
+ "properties": [
238
+ {
239
+ "name": "message",
240
+ "type": "string",
241
+ "description": "Error message",
242
+ "meta": [
243
+ {
244
+ "name": "required",
245
+ "value": "true"
246
+ }
247
+ ]
248
+ },
249
+ {
250
+ "name": "code",
251
+ "type": "string",
252
+ "description": "Error code",
253
+ "meta": []
254
+ }
255
+ ],
256
+ "meta": [
257
+ {
258
+ "name": "status",
259
+ "value": "404"
260
+ },
261
+ {
262
+ "name": "contentType",
263
+ "value": "application/json"
264
+ },
265
+ {
266
+ "name": "definitionDescription",
267
+ "value": ""
268
+ }
269
+ ]
270
+ }
271
+ ],
272
+ "properties": []
273
+ }
274
+ ]
275
+ },
276
+ {
277
+ "title": "Add a book",
278
+ "canonical": "addBook",
279
+ "description": "Create a new book",
280
+ "type": "rest_post",
281
+ "category": "rest",
282
+ "context": {
283
+ "method": "post",
284
+ "path": "/books",
285
+ "fullPath": "https:/api.example.com/v1/books",
286
+ "group": [
287
+ ""
288
+ ],
289
+ "scopes": []
290
+ },
291
+ "examples": {
292
+ "groups": [
293
+ {
294
+ "description": "Example request",
295
+ "examples": [
296
+ {
297
+ "codeblock": {
298
+ "tabs": [
299
+ {
300
+ "title": "shell",
301
+ "language": "shell",
302
+ "code": "curl --request \\\n --url https://api.example.com/v1 \\\n --header 'accept: application/json' \\\n --header 'content-type: application/json' \\\n --data '\n{\n \"title\": \"The Great Gatsby\",\n \"info\": {\n \"date\": \"1925-04-10\"\n }\n}\n'"
303
+ },
304
+ {
305
+ "title": "javascript",
306
+ "language": "javascript",
307
+ "code": "const options = {\n method: '',\n headers: {accept: 'application/json', 'content-type': 'application/json'},\n body: JSON.stringify({title: 'The Great Gatsby', info: {date: '1925-04-10'}})\n};\n\nfetch('https://api.example.com/v1', options)\n .then(res => res.json())\n .then(res => console.log(res))\n .catch(err => console.error(err));"
308
+ },
309
+ {
310
+ "title": "python",
311
+ "language": "python",
312
+ "code": "import requests\n\nurl = \"https://api.example.com/v1\"\n\npayload = {\n \"title\": \"The Great Gatsby\",\n \"info\": { \"date\": \"1925-04-10\" }\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)"
313
+ },
314
+ {
315
+ "title": "go",
316
+ "language": "go",
317
+ "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 := \"https://api.example.com/v1\"\n\n\tpayload := strings.NewReader(\"{\\\"title\\\":\\\"The Great Gatsby\\\",\\\"info\\\":{\\\"date\\\":\\\"1925-04-10\\\"}}\")\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}"
318
+ }
319
+ ]
320
+ }
321
+ }
322
+ ]
323
+ },
324
+ {
325
+ "description": "Example response",
326
+ "examples": [
327
+ {
328
+ "codeblock": {
329
+ "title": "201",
330
+ "tabs": [
331
+ {
332
+ "title": "application/json",
333
+ "language": "json",
334
+ "code": "{\n \"title\": \"The Great Gatsby\",\n \"author_name\": \"F. Scott Fitzgerald\",\n \"info\": {\n \"date\": \"1925-04-10\"\n }\n}"
335
+ }
336
+ ]
337
+ }
338
+ },
339
+ {
340
+ "codeblock": {
341
+ "title": "400",
342
+ "tabs": [
343
+ {
344
+ "title": "application/json",
345
+ "language": "json",
346
+ "code": "{\n \"message\": \"Book not found\",\n \"code\": \"BOOK_NOT_FOUND\"\n}"
347
+ }
348
+ ]
349
+ }
350
+ }
351
+ ]
352
+ }
353
+ ]
354
+ },
355
+ "definitions": [
356
+ {
357
+ "title": "Request body",
358
+ "variants": [
359
+ {
360
+ "title": "application/json",
361
+ "description": "",
362
+ "properties": [
363
+ {
364
+ "name": "title",
365
+ "type": "string",
366
+ "description": "The title of the book",
367
+ "meta": [
368
+ {
369
+ "name": "required",
370
+ "value": "true"
371
+ }
372
+ ]
373
+ },
374
+ {
375
+ "name": "info",
376
+ "type": "object",
377
+ "description": "",
378
+ "meta": [
379
+ {
380
+ "name": "required",
381
+ "value": "true"
382
+ },
383
+ {
384
+ "name": "example",
385
+ "value": "{\"date\":\"1925-04-10\"}"
386
+ }
387
+ ],
388
+ "properties": [
389
+ {
390
+ "name": "date",
391
+ "type": "string",
392
+ "description": "The date of the book",
393
+ "meta": [
394
+ {
395
+ "name": "required",
396
+ "value": "true"
397
+ }
398
+ ]
399
+ }
400
+ ]
401
+ }
402
+ ],
403
+ "meta": [
404
+ {
405
+ "name": "contentType",
406
+ "value": "application/json"
407
+ },
408
+ {
409
+ "name": "required",
410
+ "value": "true"
411
+ }
412
+ ]
413
+ }
414
+ ],
415
+ "properties": [],
416
+ "meta": [
417
+ {
418
+ "name": "required",
419
+ "value": "true"
420
+ }
421
+ ]
422
+ },
423
+ {
424
+ "title": "Response",
425
+ "variants": [
426
+ {
427
+ "title": "201",
428
+ "description": "Book created successfully",
429
+ "properties": [
430
+ {
431
+ "name": "title",
432
+ "type": "string",
433
+ "description": "The title of the book",
434
+ "meta": [
435
+ {
436
+ "name": "required",
437
+ "value": "true"
438
+ }
439
+ ]
440
+ },
441
+ {
442
+ "name": "author_name",
443
+ "type": "string",
444
+ "description": "The author of the book",
445
+ "meta": [
446
+ {
447
+ "name": "required",
448
+ "value": "true"
449
+ }
450
+ ]
451
+ },
452
+ {
453
+ "name": "info",
454
+ "type": "object",
455
+ "description": "",
456
+ "meta": [
457
+ {
458
+ "name": "required",
459
+ "value": "true"
460
+ },
461
+ {
462
+ "name": "example",
463
+ "value": "{\"date\":\"1925-04-10\"}"
464
+ }
465
+ ],
466
+ "properties": [
467
+ {
468
+ "name": "date",
469
+ "type": "string",
470
+ "description": "The date of the book",
471
+ "meta": [
472
+ {
473
+ "name": "required",
474
+ "value": "true"
475
+ }
476
+ ]
477
+ }
478
+ ]
479
+ }
480
+ ],
481
+ "meta": [
482
+ {
483
+ "name": "status",
484
+ "value": "201"
485
+ },
486
+ {
487
+ "name": "contentType",
488
+ "value": "application/json"
489
+ },
490
+ {
491
+ "name": "definitionDescription",
492
+ "value": ""
493
+ }
494
+ ]
495
+ },
496
+ {
497
+ "title": "400",
498
+ "description": "Bad request",
499
+ "properties": [
500
+ {
501
+ "name": "message",
502
+ "type": "string",
503
+ "description": "Error message",
504
+ "meta": [
505
+ {
506
+ "name": "required",
507
+ "value": "true"
508
+ }
509
+ ]
510
+ },
511
+ {
512
+ "name": "code",
513
+ "type": "string",
514
+ "description": "Error code",
515
+ "meta": []
516
+ }
517
+ ],
518
+ "meta": [
519
+ {
520
+ "name": "status",
521
+ "value": "400"
522
+ },
523
+ {
524
+ "name": "contentType",
525
+ "value": "application/json"
526
+ },
527
+ {
528
+ "name": "definitionDescription",
529
+ "value": ""
530
+ }
531
+ ]
532
+ }
533
+ ],
534
+ "properties": []
535
+ }
536
+ ]
537
+ },
538
+ {
539
+ "title": "Add an author",
540
+ "canonical": "addAuthor",
541
+ "description": "Create a new author",
542
+ "type": "rest_post",
543
+ "category": "rest",
544
+ "context": {
545
+ "method": "post",
546
+ "path": "/authors",
547
+ "fullPath": "https:/api.example.com/v1/authors",
548
+ "group": [
549
+ ""
550
+ ],
551
+ "scopes": []
552
+ },
553
+ "examples": {
554
+ "groups": [
555
+ {
556
+ "description": "Example request",
557
+ "examples": [
558
+ {
559
+ "codeblock": {
560
+ "tabs": [
561
+ {
562
+ "title": "shell",
563
+ "language": "shell",
564
+ "code": "curl --request \\\n --url https://api.example.com/v1 \\\n --header 'accept: application/json' \\\n --header 'content-type: application/json' \\\n --data '{\"name\":\"string\"}'"
565
+ },
566
+ {
567
+ "title": "javascript",
568
+ "language": "javascript",
569
+ "code": "const options = {\n method: '',\n headers: {accept: 'application/json', 'content-type': 'application/json'},\n body: JSON.stringify({name: 'string'})\n};\n\nfetch('https://api.example.com/v1', options)\n .then(res => res.json())\n .then(res => console.log(res))\n .catch(err => console.error(err));"
570
+ },
571
+ {
572
+ "title": "python",
573
+ "language": "python",
574
+ "code": "import requests\n\nurl = \"https://api.example.com/v1\"\n\npayload = { \"name\": \"string\" }\nheaders = {\n \"accept\": \"application/json\",\n \"content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\", url, json=payload, headers=headers)\n\nprint(response.text)"
575
+ },
576
+ {
577
+ "title": "go",
578
+ "language": "go",
579
+ "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 := \"https://api.example.com/v1\"\n\n\tpayload := strings.NewReader(\"{\\\"name\\\":\\\"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}"
580
+ }
581
+ ]
582
+ }
583
+ }
584
+ ]
585
+ },
586
+ {
587
+ "description": "Example response",
588
+ "examples": [
589
+ {
590
+ "codeblock": {
591
+ "title": "201",
592
+ "tabs": [
593
+ {
594
+ "title": "application/json",
595
+ "language": "json",
596
+ "code": "{\n \"name\": \"F. Scott Fitzgerald\",\n \"books\": [\n \"The Great Gatsby\",\n \"Tender Is the Night\"\n ]\n}"
597
+ }
598
+ ]
599
+ }
600
+ },
601
+ {
602
+ "codeblock": {
603
+ "title": "400",
604
+ "tabs": [
605
+ {
606
+ "title": "application/json",
607
+ "language": "json",
608
+ "code": "{\n \"message\": \"Book not found\",\n \"code\": \"BOOK_NOT_FOUND\"\n}"
609
+ }
610
+ ]
611
+ }
612
+ }
613
+ ]
614
+ }
615
+ ]
616
+ },
617
+ "definitions": [
618
+ {
619
+ "title": "Request body",
620
+ "variants": [
621
+ {
622
+ "title": "application/json",
623
+ "description": "",
624
+ "properties": [
625
+ {
626
+ "name": "name",
627
+ "type": "string",
628
+ "description": "The name of the author",
629
+ "meta": [
630
+ {
631
+ "name": "required",
632
+ "value": "true"
633
+ }
634
+ ]
635
+ }
636
+ ],
637
+ "meta": [
638
+ {
639
+ "name": "contentType",
640
+ "value": "application/json"
641
+ },
642
+ {
643
+ "name": "required",
644
+ "value": "true"
645
+ }
646
+ ]
647
+ }
648
+ ],
649
+ "properties": [],
650
+ "meta": [
651
+ {
652
+ "name": "required",
653
+ "value": "true"
654
+ }
655
+ ]
656
+ },
657
+ {
658
+ "title": "Response",
659
+ "variants": [
660
+ {
661
+ "title": "201",
662
+ "description": "Author created successfully",
663
+ "properties": [
664
+ {
665
+ "name": "name",
666
+ "type": "string",
667
+ "description": "The name of the author",
668
+ "meta": [
669
+ {
670
+ "name": "required",
671
+ "value": "true"
672
+ }
673
+ ]
674
+ },
675
+ {
676
+ "name": "books",
677
+ "type": "$$array",
678
+ "description": "The books of the author",
679
+ "meta": [],
680
+ "properties": [],
681
+ "ofProperty": {
682
+ "name": "",
683
+ "type": "string",
684
+ "properties": [],
685
+ "description": "",
686
+ "meta": []
687
+ }
688
+ }
689
+ ],
690
+ "meta": [
691
+ {
692
+ "name": "status",
693
+ "value": "201"
694
+ },
695
+ {
696
+ "name": "contentType",
697
+ "value": "application/json"
698
+ },
699
+ {
700
+ "name": "definitionDescription",
701
+ "value": ""
702
+ }
703
+ ]
704
+ },
705
+ {
706
+ "title": "400",
707
+ "description": "Bad request",
708
+ "properties": [
709
+ {
710
+ "name": "message",
711
+ "type": "string",
712
+ "description": "Error message",
713
+ "meta": [
714
+ {
715
+ "name": "required",
716
+ "value": "true"
717
+ }
718
+ ]
719
+ },
720
+ {
721
+ "name": "code",
722
+ "type": "string",
723
+ "description": "Error code",
724
+ "meta": []
725
+ }
726
+ ],
727
+ "meta": [
728
+ {
729
+ "name": "status",
730
+ "value": "400"
731
+ },
732
+ {
733
+ "name": "contentType",
734
+ "value": "application/json"
735
+ },
736
+ {
737
+ "name": "definitionDescription",
738
+ "value": ""
739
+ }
740
+ ]
741
+ }
742
+ ],
743
+ "properties": []
744
+ }
745
+ ]
746
+ },
747
+ {
748
+ "title": "Book",
749
+ "description": "",
750
+ "canonical": "objects/Book",
751
+ "definitions": [
752
+ {
753
+ "title": "Book",
754
+ "properties": [
755
+ {
756
+ "name": "title",
757
+ "type": "string",
758
+ "description": "The title of the book",
759
+ "meta": [
760
+ {
761
+ "name": "required",
762
+ "value": "true"
763
+ }
764
+ ]
765
+ },
766
+ {
767
+ "name": "author_name",
768
+ "type": "string",
769
+ "description": "The author of the book",
770
+ "meta": [
771
+ {
772
+ "name": "required",
773
+ "value": "true"
774
+ }
775
+ ]
776
+ },
777
+ {
778
+ "name": "info",
779
+ "type": "object",
780
+ "description": "",
781
+ "meta": [
782
+ {
783
+ "name": "required",
784
+ "value": "true"
785
+ },
786
+ {
787
+ "name": "example",
788
+ "value": "{\"date\":\"1925-04-10\"}"
789
+ }
790
+ ],
791
+ "properties": [
792
+ {
793
+ "name": "date",
794
+ "type": "string",
795
+ "description": "The date of the book",
796
+ "meta": [
797
+ {
798
+ "name": "required",
799
+ "value": "true"
800
+ }
801
+ ]
802
+ }
803
+ ]
804
+ }
805
+ ],
806
+ "meta": []
807
+ }
808
+ ],
809
+ "examples": {
810
+ "groups": [
811
+ {
812
+ "description": "Example",
813
+ "examples": [
814
+ {
815
+ "codeblock": {
816
+ "tabs": [
817
+ {
818
+ "title": "json",
819
+ "language": "json",
820
+ "code": "{\n \"title\": \"The Great Gatsby\",\n \"author_name\": \"F. Scott Fitzgerald\",\n \"info\": {\n \"date\": \"1925-04-10\"\n }\n}"
821
+ }
822
+ ]
823
+ }
824
+ }
825
+ ]
826
+ }
827
+ ]
828
+ },
829
+ "type": "rest_component_schema",
830
+ "context": {
831
+ "componentSchema": "Book",
832
+ "group": [
833
+ "Objects"
834
+ ]
835
+ }
836
+ },
837
+ {
838
+ "title": "BookInfo",
839
+ "description": "",
840
+ "canonical": "objects/BookInfo",
841
+ "definitions": [
842
+ {
843
+ "title": "BookInfo",
844
+ "properties": [
845
+ {
846
+ "name": "date",
847
+ "type": "string",
848
+ "description": "The date of the book",
849
+ "meta": [
850
+ {
851
+ "name": "required",
852
+ "value": "true"
853
+ }
854
+ ]
855
+ }
856
+ ],
857
+ "meta": []
858
+ }
859
+ ],
860
+ "examples": {
861
+ "groups": [
862
+ {
863
+ "description": "Example",
864
+ "examples": [
865
+ {
866
+ "codeblock": {
867
+ "tabs": [
868
+ {
869
+ "title": "json",
870
+ "language": "json",
871
+ "code": "{\n \"date\": \"1925-04-10\"\n}"
872
+ }
873
+ ]
874
+ }
875
+ }
876
+ ]
877
+ }
878
+ ]
879
+ },
880
+ "type": "rest_component_schema",
881
+ "context": {
882
+ "componentSchema": "BookInfo",
883
+ "group": [
884
+ "Objects"
885
+ ]
886
+ }
887
+ },
888
+ {
889
+ "title": "Author",
890
+ "description": "",
891
+ "canonical": "objects/Author",
892
+ "definitions": [
893
+ {
894
+ "title": "Author",
895
+ "properties": [
896
+ {
897
+ "name": "name",
898
+ "type": "string",
899
+ "description": "The name of the author",
900
+ "meta": [
901
+ {
902
+ "name": "required",
903
+ "value": "true"
904
+ }
905
+ ]
906
+ },
907
+ {
908
+ "name": "books",
909
+ "type": "$$array",
910
+ "description": "The books of the author",
911
+ "meta": [],
912
+ "properties": [],
913
+ "ofProperty": {
914
+ "name": "",
915
+ "type": "string",
916
+ "properties": [],
917
+ "description": "",
918
+ "meta": []
919
+ }
920
+ }
921
+ ],
922
+ "meta": []
923
+ }
924
+ ],
925
+ "examples": {
926
+ "groups": [
927
+ {
928
+ "description": "Example",
929
+ "examples": [
930
+ {
931
+ "codeblock": {
932
+ "tabs": [
933
+ {
934
+ "title": "json",
935
+ "language": "json",
936
+ "code": "{\n \"name\": \"F. Scott Fitzgerald\",\n \"books\": [\n \"The Great Gatsby\",\n \"Tender Is the Night\"\n ]\n}"
937
+ }
938
+ ]
939
+ }
940
+ }
941
+ ]
942
+ }
943
+ ]
944
+ },
945
+ "type": "rest_component_schema",
946
+ "context": {
947
+ "componentSchema": "Author",
948
+ "group": [
949
+ "Objects"
950
+ ]
951
+ }
952
+ },
953
+ {
954
+ "title": "BookInput",
955
+ "description": "",
956
+ "canonical": "objects/BookInput",
957
+ "definitions": [
958
+ {
959
+ "title": "BookInput",
960
+ "properties": [
961
+ {
962
+ "name": "title",
963
+ "type": "string",
964
+ "description": "The title of the book",
965
+ "meta": [
966
+ {
967
+ "name": "required",
968
+ "value": "true"
969
+ }
970
+ ]
971
+ },
972
+ {
973
+ "name": "info",
974
+ "type": "object",
975
+ "description": "",
976
+ "meta": [
977
+ {
978
+ "name": "required",
979
+ "value": "true"
980
+ },
981
+ {
982
+ "name": "example",
983
+ "value": "{\"date\":\"1925-04-10\"}"
984
+ }
985
+ ],
986
+ "properties": [
987
+ {
988
+ "name": "date",
989
+ "type": "string",
990
+ "description": "The date of the book",
991
+ "meta": [
992
+ {
993
+ "name": "required",
994
+ "value": "true"
995
+ }
996
+ ]
997
+ }
998
+ ]
999
+ }
1000
+ ],
1001
+ "meta": []
1002
+ }
1003
+ ],
1004
+ "examples": {
1005
+ "groups": [
1006
+ {
1007
+ "description": "Example",
1008
+ "examples": [
1009
+ {
1010
+ "codeblock": {
1011
+ "tabs": [
1012
+ {
1013
+ "title": "json",
1014
+ "language": "json",
1015
+ "code": "{\n \"title\": \"The Great Gatsby\",\n \"info\": {\n \"date\": \"1925-04-10\"\n }\n}"
1016
+ }
1017
+ ]
1018
+ }
1019
+ }
1020
+ ]
1021
+ }
1022
+ ]
1023
+ },
1024
+ "type": "rest_component_schema",
1025
+ "context": {
1026
+ "componentSchema": "BookInput",
1027
+ "group": [
1028
+ "Objects"
1029
+ ]
1030
+ }
1031
+ },
1032
+ {
1033
+ "title": "BookInfoInput",
1034
+ "description": "",
1035
+ "canonical": "objects/BookInfoInput",
1036
+ "definitions": [
1037
+ {
1038
+ "title": "BookInfoInput",
1039
+ "properties": [
1040
+ {
1041
+ "name": "date",
1042
+ "type": "string",
1043
+ "description": "The date of the book",
1044
+ "meta": [
1045
+ {
1046
+ "name": "required",
1047
+ "value": "true"
1048
+ }
1049
+ ]
1050
+ }
1051
+ ],
1052
+ "meta": []
1053
+ }
1054
+ ],
1055
+ "examples": {
1056
+ "groups": [
1057
+ {
1058
+ "description": "Example",
1059
+ "examples": [
1060
+ {
1061
+ "codeblock": {
1062
+ "tabs": [
1063
+ {
1064
+ "title": "json",
1065
+ "language": "json",
1066
+ "code": "{\n \"date\": \"1925-04-10\"\n}"
1067
+ }
1068
+ ]
1069
+ }
1070
+ }
1071
+ ]
1072
+ }
1073
+ ]
1074
+ },
1075
+ "type": "rest_component_schema",
1076
+ "context": {
1077
+ "componentSchema": "BookInfoInput",
1078
+ "group": [
1079
+ "Objects"
1080
+ ]
1081
+ }
1082
+ },
1083
+ {
1084
+ "title": "Error",
1085
+ "description": "",
1086
+ "canonical": "objects/Error",
1087
+ "definitions": [
1088
+ {
1089
+ "title": "Error",
1090
+ "properties": [
1091
+ {
1092
+ "name": "message",
1093
+ "type": "string",
1094
+ "description": "Error message",
1095
+ "meta": [
1096
+ {
1097
+ "name": "required",
1098
+ "value": "true"
1099
+ }
1100
+ ]
1101
+ },
1102
+ {
1103
+ "name": "code",
1104
+ "type": "string",
1105
+ "description": "Error code",
1106
+ "meta": []
1107
+ }
1108
+ ],
1109
+ "meta": []
1110
+ }
1111
+ ],
1112
+ "examples": {
1113
+ "groups": [
1114
+ {
1115
+ "description": "Example",
1116
+ "examples": [
1117
+ {
1118
+ "codeblock": {
1119
+ "tabs": [
1120
+ {
1121
+ "title": "json",
1122
+ "language": "json",
1123
+ "code": "{\n \"message\": \"Book not found\",\n \"code\": \"BOOK_NOT_FOUND\"\n}"
1124
+ }
1125
+ ]
1126
+ }
1127
+ }
1128
+ ]
1129
+ }
1130
+ ]
1131
+ },
1132
+ "type": "rest_component_schema",
1133
+ "context": {
1134
+ "componentSchema": "Error",
1135
+ "group": [
1136
+ "Objects"
1137
+ ]
1138
+ }
1139
+ }
1140
+ ]