Skip to content

Commit 87a1100

Browse files
author
Clemens Vasters
committed
Fix bare $ref violations to comply with spec Section 3.4.1
Wrap bare $ref usages in { type: { $ref: ... } } format as required by spec.
1 parent 81da4e3 commit 87a1100

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

json-structure-primer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -721,8 +721,8 @@ Inline unions extend a common abstract base type and use a selector property:
721721
"$extends": "#/definitions/Address",
722722
"selector": "addressType",
723723
"choices": {
724-
"StreetAddress": { "$ref": "#/definitions/StreetAddress" },
725-
"PostOfficeBoxAddress": { "$ref": "#/definitions/PostOfficeBoxAddress" }
724+
"StreetAddress": { "type": { "$ref": "#/definitions/StreetAddress" } },
725+
"PostOfficeBoxAddress": { "type": { "$ref": "#/definitions/PostOfficeBoxAddress" } }
726726
},
727727
"definitions": {
728728
"Address": {

samples/core/11-sets-and-maps/schema.struct.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@
7070
"type": "map",
7171
"description": "Books indexed by ISBN",
7272
"keys": { "type": "string" },
73-
"values": { "$ref": "#/definitions/Book" }
73+
"values": { "type": { "$ref": "#/definitions/Book" } }
7474
},
7575
"authors": {
7676
"type": "map",
7777
"description": "Authors indexed by author ID",
7878
"keys": { "type": "uuid" },
79-
"values": { "$ref": "#/definitions/Author" }
79+
"values": { "type": { "$ref": "#/definitions/Author" } }
8080
},
8181
"categories": {
8282
"type": "set",

samples/core/12-multiple-inheritance/schema.struct.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"name": "MultipleInheritanceExample",
55
"version": "1.0",
66
"description": "Demonstrates multiple inheritance using $extends with an array of JSON Pointers",
7-
"type": "object",
8-
"$ref": "#/definitions/FlyingCar",
7+
"$root": "#/definitions/FlyingCar",
98
"definitions": {
109
"Vehicle": {
1110
"name": "Vehicle",

samples/import/02-namespace-import/schema.struct.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"items": {
2929
"type": "array",
3030
"description": "Order items",
31-
"items": { "$ref": "#/definitions/OrderItem" }
31+
"items": { "type": { "$ref": "#/definitions/OrderItem" } }
3232
},
3333
"totalAmount": {
3434
"type": { "$ref": "#/definitions/Finance/Money" },

samples/import/04-shadowing/schema.struct.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"paymentMethods": {
2222
"type": "array",
2323
"description": "Available payment methods",
24-
"items": { "$ref": "#/definitions/FinanceTypes/PaymentMethod" }
24+
"items": { "type": { "$ref": "#/definitions/FinanceTypes/PaymentMethod" } }
2525
}
2626
},
2727
"required": ["customerId", "profile"],

0 commit comments

Comments
 (0)