docusaurus-plugin-generate-schema-docs 1.2.0 → 1.3.0

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 (81) hide show
  1. package/README.md +42 -6
  2. package/__tests__/ExampleDataLayer.test.js +78 -155
  3. package/__tests__/__fixtures__/static/schemas/add-to-cart-event.json +4 -15
  4. package/__tests__/__fixtures__/static/schemas/choice-event.json +72 -0
  5. package/__tests__/__fixtures__/static/schemas/components/dataLayer.json +52 -54
  6. package/__tests__/__fixtures__/static/schemas/components/product.json +124 -210
  7. package/__tests__/__fixtures__/static/schemas/nested/child-event.json +10 -0
  8. package/__tests__/__fixtures__/static/schemas/nested/grandchild-a.json +9 -0
  9. package/__tests__/__fixtures__/static/schemas/nested/grandchild-b.json +9 -0
  10. package/__tests__/__fixtures__/static/schemas/nested/parent-event.json +7 -0
  11. package/__tests__/__fixtures__/static/schemas/root-any-of-event.json +34 -0
  12. package/__tests__/__fixtures__/static/schemas/root-choice-event.json +36 -0
  13. package/__tests__/__fixtures__/validateSchemas/circular-schema.json +6 -6
  14. package/__tests__/__fixtures__/validateSchemas/components/referenced.json +9 -7
  15. package/__tests__/__fixtures__/validateSchemas/invalid-example-schema.json +7 -7
  16. package/__tests__/__fixtures__/validateSchemas/main-schema-with-missing-ref.json +7 -7
  17. package/__tests__/__fixtures__/validateSchemas/main-schema-with-ref.json +7 -7
  18. package/__tests__/__fixtures__/validateSchemas/no-example-schema.json +11 -11
  19. package/__tests__/__fixtures__/validateSchemas/schema-A.json +5 -5
  20. package/__tests__/__fixtures__/validateSchemas/schema-B.json +5 -5
  21. package/__tests__/__fixtures__/validateSchemas/valid-schema.json +7 -7
  22. package/__tests__/__fixtures_versioned__/static/schemas/1.1.1/add-to-cart-event.json +44 -0
  23. package/__tests__/__fixtures_versioned__/static/schemas/1.1.1/components/dataLayer.json +56 -0
  24. package/__tests__/__fixtures_versioned__/static/schemas/1.1.1/components/product.json +125 -0
  25. package/__tests__/__fixtures_versioned__/static/schemas/next/add-to-cart-event.json +44 -0
  26. package/__tests__/__fixtures_versioned__/static/schemas/next/components/dataLayer.json +56 -0
  27. package/__tests__/__fixtures_versioned__/static/schemas/next/components/product.json +125 -0
  28. package/__tests__/__fixtures_versioned__/versions.json +1 -0
  29. package/__tests__/__snapshots__/ExampleDataLayer.test.js.snap +117 -0
  30. package/__tests__/__snapshots__/generateEventDocs.nested.test.js.snap +92 -0
  31. package/__tests__/__snapshots__/generateEventDocs.test.js.snap +113 -15
  32. package/__tests__/__snapshots__/generateEventDocs.versioned.test.js.snap +53 -0
  33. package/__tests__/components/FoldableRows.test.js +330 -0
  34. package/__tests__/components/PropertiesTable.test.js +31 -14
  35. package/__tests__/components/PropertyRow.test.js +471 -51
  36. package/__tests__/components/SchemaJsonViewer.test.js +23 -19
  37. package/__tests__/components/SchemaRows.test.js +96 -66
  38. package/__tests__/components/SchemaViewer.test.js +34 -17
  39. package/__tests__/components/TableHeader.test.js +12 -12
  40. package/__tests__/generateEventDocs.nested.test.js +80 -0
  41. package/__tests__/generateEventDocs.test.js +77 -71
  42. package/__tests__/generateEventDocs.versioned.test.js +69 -0
  43. package/__tests__/helpers/buildExampleFromSchema.test.js +160 -160
  44. package/__tests__/helpers/file-system.test.js +44 -0
  45. package/__tests__/helpers/getConstraints.test.js +48 -48
  46. package/__tests__/helpers/loadSchema.test.js +11 -5
  47. package/__tests__/helpers/path-helpers.test.js +34 -0
  48. package/__tests__/helpers/processSchema.test.js +42 -22
  49. package/__tests__/helpers/schema-processing.test.js +82 -0
  50. package/__tests__/helpers/schemaToExamples.test.js +56 -0
  51. package/__tests__/helpers/schemaToTableData.filtering.test.js +65 -0
  52. package/__tests__/helpers/schemaToTableData.hierarchicalLines.test.js +539 -0
  53. package/__tests__/helpers/schemaToTableData.test.js +222 -0
  54. package/__tests__/helpers/update-schema-ids.test.js +107 -0
  55. package/__tests__/update-schema-ids.test.js +39 -0
  56. package/__tests__/validateSchemas.test.js +125 -88
  57. package/components/ExampleDataLayer.js +59 -28
  58. package/components/FoldableRows.js +164 -0
  59. package/components/PropertiesTable.js +10 -7
  60. package/components/PropertyRow.js +169 -60
  61. package/components/SchemaJsonViewer.js +6 -6
  62. package/components/SchemaRows.css +236 -14
  63. package/components/SchemaRows.js +24 -41
  64. package/components/SchemaViewer.js +19 -13
  65. package/components/TableHeader.js +12 -12
  66. package/generateEventDocs.js +141 -61
  67. package/helpers/buildExampleFromSchema.js +58 -72
  68. package/helpers/choice-index-template.js +22 -0
  69. package/helpers/file-system.js +32 -0
  70. package/helpers/getConstraints.js +43 -44
  71. package/helpers/loadSchema.js +2 -2
  72. package/helpers/path-helpers.js +22 -0
  73. package/helpers/processSchema.js +19 -19
  74. package/helpers/{mdx-template.js → schema-doc-template.js} +12 -12
  75. package/helpers/schema-processing.js +75 -0
  76. package/helpers/schemaToExamples.js +99 -0
  77. package/helpers/schemaToTableData.js +311 -0
  78. package/helpers/update-schema-ids.js +47 -0
  79. package/index.js +143 -54
  80. package/package.json +1 -1
  81. package/validateSchemas.js +54 -71
@@ -1,211 +1,125 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://tracking-docs-demo.buchert.digital/schemas/components/product.json",
4
- "title": "A Product",
5
- "description": "A product object representing an item for use within a purchase event, based on Google Analytics 4 ecommerce event specifications.",
6
- "type": "object",
7
- "properties": {
8
- "item_id": {
9
- "type": "string",
10
- "description": "The ID of the item. Either item_id or item_name is required.",
11
- "examples": [
12
- "SKU_12345",
13
- "PROD_98765"
14
- ]
15
- },
16
- "item_name": {
17
- "type": "string",
18
- "description": "The name of the item. Either item_id or item_name is required.",
19
- "examples": [
20
- "Stan and Friends Tee",
21
- "Blue Running Shoes"
22
- ]
23
- },
24
- "affiliation": {
25
- "type": "string",
26
- "description": "A product affiliation to indicate a supplier or store. Note: affiliation is only available at the item level.",
27
- "examples": [
28
- "Google Merchandise Store",
29
- "Nike Store"
30
- ]
31
- },
32
- "coupon": {
33
- "type": "string",
34
- "description": "The coupon name/code associated with the item. Coupon parameters at event and item levels are independent.",
35
- "examples": [
36
- "SUMMER_FUN",
37
- "WELCOME20",
38
- "SAVE10"
39
- ]
40
- },
41
- "discount": {
42
- "type": "number",
43
- "description": "The monetary value of the discount per unit applied to the item.",
44
- "examples": [
45
- 2.22,
46
- 5.00,
47
- 10.50
48
- ]
49
- },
50
- "index": {
51
- "type": "number",
52
- "description": "The index or position of the item in a list.",
53
- "examples": [
54
- 0,
55
- 1,
56
- 2
57
- ]
58
- },
59
- "item_brand": {
60
- "type": "string",
61
- "description": "The brand of the item.",
62
- "examples": [
63
- "Google",
64
- "Nike",
65
- "Adidas"
66
- ]
67
- },
68
- "item_category": {
69
- "type": "string",
70
- "description": "The category of the item. If used as part of a category hierarchy or taxonomy, this is the first category.",
71
- "examples": [
72
- "Apparel",
73
- "Footwear",
74
- "Electronics"
75
- ]
76
- },
77
- "item_category2": {
78
- "type": "string",
79
- "description": "The second category hierarchy or additional taxonomy of the item.",
80
- "examples": [
81
- "Adult",
82
- "Women",
83
- "Men"
84
- ]
85
- },
86
- "item_category3": {
87
- "type": "string",
88
- "description": "The third category hierarchy or additional taxonomy of the item.",
89
- "examples": [
90
- "Shirts",
91
- "Shoes",
92
- "Boots"
93
- ]
94
- },
95
- "item_category4": {
96
- "type": "string",
97
- "description": "The fourth category hierarchy or additional taxonomy of the item.",
98
- "examples": [
99
- "Crew",
100
- "Running",
101
- "Casual"
102
- ]
103
- },
104
- "item_category5": {
105
- "type": "string",
106
- "description": "The fifth category hierarchy or additional taxonomy of the item.",
107
- "examples": [
108
- "Short sleeve",
109
- "Long distance",
110
- "Lightweight"
111
- ]
112
- },
113
- "item_list_id": {
114
- "type": "string",
115
- "description": "The ID of the list in which the item was presented to the user. If set, item_list_id at the event level is ignored. If not set, item_list_id at the event level is used if available.",
116
- "examples": [
117
- "related_products",
118
- "search_results",
119
- "recommendations"
120
- ]
121
- },
122
- "item_list_name": {
123
- "type": "string",
124
- "description": "The name of the list in which the item was presented to the user. If set, item_list_name at the event level is ignored. If not set, item_list_name at the event level is used if available.",
125
- "examples": [
126
- "Related Products",
127
- "Search Results",
128
- "Recommended Items"
129
- ]
130
- },
131
- "item_variant": {
132
- "type": "string",
133
- "description": "The item variant or unique code or description for additional item details/options.",
134
- "examples": [
135
- "green",
136
- "Blue Size 10",
137
- "M-Black"
138
- ]
139
- },
140
- "location_id": {
141
- "type": "string",
142
- "description": "The physical location associated with the item, such as the location of a brick-and-mortar store. It is recommended to use the Google Place ID that corresponds to the associated item. A custom location ID can also be used. Note: location_id is only available at the item level.",
143
- "examples": [
144
- "ChIJIQBpAG2ahYAR_6128GcTUEo",
145
- "store_123",
146
- "location_sf"
147
- ]
148
- },
149
- "price": {
150
- "type": "number",
151
- "description": "The price of the item in the specified currency unit. If a discount is applied to the item, set price to the reduced per-unit price and provide the per-unit price discount in the discount parameter.",
152
- "examples": [
153
- 10.01,
154
- 21.01,
155
- 89.99
156
- ]
157
- },
158
- "quantity": {
159
- "type": "number",
160
- "description": "The item quantity. If not set, quantity is set to 1.",
161
- "examples": [
162
- 1,
163
- 2,
164
- 3
165
- ]
166
- },
167
- "promotion_id": {
168
- "type": "string",
169
- "description": "The ID of the promotion associated with the item.",
170
- "examples": [
171
- "P_12345",
172
- "PROMO_001"
173
- ]
174
- },
175
- "promotion_name": {
176
- "type": "string",
177
- "description": "The name of the promotion associated with the item.",
178
- "examples": [
179
- "Summer Sale",
180
- "Black Friday",
181
- "Flash Deal"
182
- ]
183
- },
184
- "creative_name": {
185
- "type": "string",
186
- "description": "The name of the promotion creative.",
187
- "examples": [
188
- "summer_banner2",
189
- "holiday_email_v1"
190
- ]
191
- },
192
- "creative_slot": {
193
- "type": "string",
194
- "description": "The name of the creative slot associated with the item.",
195
- "examples": [
196
- "featured_app_1",
197
- "top_banner",
198
- "sidebar"
199
- ]
200
- },
201
- "google_business_vertical": {
202
- "type": "string",
203
- "description": "The business vertical for the item (e.g., 'retail').",
204
- "examples": [
205
- "retail",
206
- "ecommerce"
207
- ]
208
- }
209
- },
210
- "required": []
211
- }
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://tracking-docs-demo.buchert.digital/schemas/components/product.json",
4
+ "title": "A Product",
5
+ "description": "A product object representing an item for use within a purchase event, based on Google Analytics 4 ecommerce event specifications.",
6
+ "type": "object",
7
+ "properties": {
8
+ "item_id": {
9
+ "type": "string",
10
+ "description": "The ID of the item. Either item_id or item_name is required.",
11
+ "examples": ["SKU_12345", "PROD_98765"]
12
+ },
13
+ "item_name": {
14
+ "type": "string",
15
+ "description": "The name of the item. Either item_id or item_name is required.",
16
+ "examples": ["Stan and Friends Tee", "Blue Running Shoes"]
17
+ },
18
+ "affiliation": {
19
+ "type": "string",
20
+ "description": "A product affiliation to indicate a supplier or store. Note: affiliation is only available at the item level.",
21
+ "examples": ["Google Merchandise Store", "Nike Store"]
22
+ },
23
+ "coupon": {
24
+ "type": "string",
25
+ "description": "The coupon name/code associated with the item. Coupon parameters at event and item levels are independent.",
26
+ "examples": ["SUMMER_FUN", "WELCOME20", "SAVE10"]
27
+ },
28
+ "discount": {
29
+ "type": "number",
30
+ "description": "The monetary value of the discount per unit applied to the item.",
31
+ "examples": [2.22, 5.0, 10.5]
32
+ },
33
+ "index": {
34
+ "type": "number",
35
+ "description": "The index or position of the item in a list.",
36
+ "examples": [0, 1, 2]
37
+ },
38
+ "item_brand": {
39
+ "type": "string",
40
+ "description": "The brand of the item.",
41
+ "examples": ["Google", "Nike", "Adidas"]
42
+ },
43
+ "item_category": {
44
+ "type": "string",
45
+ "description": "The category of the item. If used as part of a category hierarchy or taxonomy, this is the first category.",
46
+ "examples": ["Apparel", "Footwear", "Electronics"]
47
+ },
48
+ "item_category2": {
49
+ "type": "string",
50
+ "description": "The second category hierarchy or additional taxonomy of the item.",
51
+ "examples": ["Adult", "Women", "Men"]
52
+ },
53
+ "item_category3": {
54
+ "type": "string",
55
+ "description": "The third category hierarchy or additional taxonomy of the item.",
56
+ "examples": ["Shirts", "Shoes", "Boots"]
57
+ },
58
+ "item_category4": {
59
+ "type": "string",
60
+ "description": "The fourth category hierarchy or additional taxonomy of the item.",
61
+ "examples": ["Crew", "Running", "Casual"]
62
+ },
63
+ "item_category5": {
64
+ "type": "string",
65
+ "description": "The fifth category hierarchy or additional taxonomy of the item.",
66
+ "examples": ["Short sleeve", "Long distance", "Lightweight"]
67
+ },
68
+ "item_list_id": {
69
+ "type": "string",
70
+ "description": "The ID of the list in which the item was presented to the user. If set, item_list_id at the event level is ignored. If not set, item_list_id at the event level is used if available.",
71
+ "examples": ["related_products", "search_results", "recommendations"]
72
+ },
73
+ "item_list_name": {
74
+ "type": "string",
75
+ "description": "The name of the list in which the item was presented to the user. If set, item_list_name at the event level is ignored. If not set, item_list_name at the event level is used if available.",
76
+ "examples": ["Related Products", "Search Results", "Recommended Items"]
77
+ },
78
+ "item_variant": {
79
+ "type": "string",
80
+ "description": "The item variant or unique code or description for additional item details/options.",
81
+ "examples": ["green", "Blue Size 10", "M-Black"]
82
+ },
83
+ "location_id": {
84
+ "type": "string",
85
+ "description": "The physical location associated with the item, such as the location of a brick-and-mortar store. It is recommended to use the Google Place ID that corresponds to the associated item. A custom location ID can also be used. Note: location_id is only available at the item level.",
86
+ "examples": ["ChIJIQBpAG2ahYAR_6128GcTUEo", "store_123", "location_sf"]
87
+ },
88
+ "price": {
89
+ "type": "number",
90
+ "description": "The price of the item in the specified currency unit. If a discount is applied to the item, set price to the reduced per-unit price and provide the per-unit price discount in the discount parameter.",
91
+ "examples": [10.01, 21.01, 89.99]
92
+ },
93
+ "quantity": {
94
+ "type": "number",
95
+ "description": "The item quantity. If not set, quantity is set to 1.",
96
+ "examples": [1, 2, 3]
97
+ },
98
+ "promotion_id": {
99
+ "type": "string",
100
+ "description": "The ID of the promotion associated with the item.",
101
+ "examples": ["P_12345", "PROMO_001"]
102
+ },
103
+ "promotion_name": {
104
+ "type": "string",
105
+ "description": "The name of the promotion associated with the item.",
106
+ "examples": ["Summer Sale", "Black Friday", "Flash Deal"]
107
+ },
108
+ "creative_name": {
109
+ "type": "string",
110
+ "description": "The name of the promotion creative.",
111
+ "examples": ["summer_banner2", "holiday_email_v1"]
112
+ },
113
+ "creative_slot": {
114
+ "type": "string",
115
+ "description": "The name of the creative slot associated with the item.",
116
+ "examples": ["featured_app_1", "top_banner", "sidebar"]
117
+ },
118
+ "google_business_vertical": {
119
+ "type": "string",
120
+ "description": "The business vertical for the item (e.g., 'retail').",
121
+ "examples": ["retail", "ecommerce"]
122
+ }
123
+ },
124
+ "required": []
125
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.com/schemas/nested/child-event.json",
4
+ "title": "Child Event",
5
+ "type": "object",
6
+ "oneOf": [
7
+ { "$ref": "./grandchild-a.json" },
8
+ { "$ref": "./grandchild-b.json" }
9
+ ]
10
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.com/schemas/nested/grandchild-a.json",
4
+ "title": "Grandchild A",
5
+ "type": "object",
6
+ "properties": {
7
+ "prop_a": { "type": "string" }
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.com/schemas/nested/grandchild-b.json",
4
+ "title": "Grandchild B",
5
+ "type": "object",
6
+ "properties": {
7
+ "prop_b": { "type": "string" }
8
+ }
9
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.com/schemas/nested/parent-event.json",
4
+ "title": "Parent Event",
5
+ "type": "object",
6
+ "oneOf": [{ "$ref": "./child-event.json" }]
7
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://tracking-docs-demo.buchert.digital/schemas/1.2.0/root-any-of-event.json",
4
+ "title": "Root AnyOf Event",
5
+ "description": "An example event that has anyOf at the root level.",
6
+ "type": "object",
7
+ "properties": {
8
+ "event": {
9
+ "type": "string",
10
+ "const": "any_of_event"
11
+ }
12
+ },
13
+ "anyOf": [
14
+ {
15
+ "title": "Has Param C",
16
+ "properties": {
17
+ "param_c": {
18
+ "type": "string",
19
+ "examples": ["example_c"],
20
+ "description": "This is the description for Param C."
21
+ }
22
+ }
23
+ },
24
+ {
25
+ "title": "Has Param D",
26
+ "properties": {
27
+ "param_d": {
28
+ "type": "boolean",
29
+ "examples": [true]
30
+ }
31
+ }
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.com/root-choice-event.schema.json",
4
+ "title": "Root Choice Event",
5
+ "description": "An example event that has oneOf at the root level.",
6
+ "oneOf": [
7
+ {
8
+ "title": "Option A",
9
+ "type": "object",
10
+ "properties": {
11
+ "event": {
12
+ "type": "string",
13
+ "const": "option_a"
14
+ },
15
+ "param_a": {
16
+ "type": "string",
17
+ "examples": ["example_a"]
18
+ }
19
+ }
20
+ },
21
+ {
22
+ "title": "Option B",
23
+ "type": "object",
24
+ "properties": {
25
+ "event": {
26
+ "type": "string",
27
+ "const": "option_b"
28
+ },
29
+ "param_b": {
30
+ "type": "integer",
31
+ "examples": [123]
32
+ }
33
+ }
34
+ }
35
+ ]
36
+ }
@@ -1,8 +1,8 @@
1
1
  {
2
- "title": "Circular Schema",
3
- "type": "object",
4
- "properties": {
5
- "name": { "type": "string" },
6
- "parent": { "$ref": "#" }
7
- }
2
+ "title": "Circular Schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "name": { "type": "string" },
6
+ "parent": { "$ref": "#" }
7
+ }
8
8
  }
@@ -1,8 +1,10 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "components/referenced.json",
4
- "title": "Referenced Component",
5
- "type": "object",
6
- "properties": { "prop": { "type": "string", "examples": ["component prop"] } },
7
- "required": ["prop"]
8
- }
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "components/referenced.json",
4
+ "title": "Referenced Component",
5
+ "type": "object",
6
+ "properties": {
7
+ "prop": { "type": "string", "examples": ["component prop"] }
8
+ },
9
+ "required": ["prop"]
10
+ }
@@ -1,8 +1,8 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "invalid-example-schema",
4
- "title": "Invalid Example Schema",
5
- "type": "object",
6
- "properties": { "age": { "type": "number", "examples": ["not-a-number"] } },
7
- "required": ["age"]
8
- }
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "invalid-example-schema",
4
+ "title": "Invalid Example Schema",
5
+ "type": "object",
6
+ "properties": { "age": { "type": "number", "examples": ["not-a-number"] } },
7
+ "required": ["age"]
8
+ }
@@ -1,8 +1,8 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "main-schema-with-missing-ref",
4
- "title": "Main Schema with Missing Ref",
5
- "type": "object",
6
- "properties": { "component": { "$ref": "non-existent-component.json" } },
7
- "required": ["component"]
8
- }
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "main-schema-with-missing-ref",
4
+ "title": "Main Schema with Missing Ref",
5
+ "type": "object",
6
+ "properties": { "component": { "$ref": "non-existent-component.json" } },
7
+ "required": ["component"]
8
+ }
@@ -1,8 +1,8 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "main-schema-with-ref",
4
- "title": "Main Schema with Ref",
5
- "type": "object",
6
- "properties": { "component": { "$ref": "components/referenced.json" } },
7
- "required": ["component"]
8
- }
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "main-schema-with-ref",
4
+ "title": "Main Schema with Ref",
5
+ "type": "object",
6
+ "properties": { "component": { "$ref": "components/referenced.json" } },
7
+ "required": ["component"]
8
+ }
@@ -1,12 +1,12 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "no-valid-example-schema",
4
- "title": "No Valid Example Schema",
5
- "type": "object",
6
- "properties": {
7
- "some_prop": {
8
- "description": "This property has no type or example, so it won't be in the generated example."
9
- }
10
- },
11
- "required": ["some_prop"]
12
- }
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "no-valid-example-schema",
4
+ "title": "No Valid Example Schema",
5
+ "type": "object",
6
+ "properties": {
7
+ "some_prop": {
8
+ "description": "This property has no type or example, so it won't be in the generated example."
9
+ }
10
+ },
11
+ "required": ["some_prop"]
12
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
- "title": "Schema A",
3
- "type": "object",
4
- "properties": {
5
- "b": { "$ref": "schema-B.json" }
6
- }
2
+ "title": "Schema A",
3
+ "type": "object",
4
+ "properties": {
5
+ "b": { "$ref": "schema-B.json" }
6
+ }
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
- "title": "Schema B",
3
- "type": "object",
4
- "properties": {
5
- "a": { "$ref": "schema-A.json" }
6
- }
2
+ "title": "Schema B",
3
+ "type": "object",
4
+ "properties": {
5
+ "a": { "$ref": "schema-A.json" }
6
+ }
7
7
  }
@@ -1,8 +1,8 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "valid-schema",
4
- "title": "Valid Schema",
5
- "type": "object",
6
- "properties": { "name": { "type": "string", "examples": ["Test"] } },
7
- "required": ["name"]
8
- }
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "valid-schema",
4
+ "title": "Valid Schema",
5
+ "type": "object",
6
+ "properties": { "name": { "type": "string", "examples": ["Test"] } },
7
+ "required": ["name"]
8
+ }