@@ -35,7 +35,7 @@ object-oriented programming.
3535 - [ 3.1. Example: Declaring a simple object type] ( #31-example-declaring-a-simple-object-type )
3636 - [ 3.2. Example: Declaring Primitive and Extended Types] ( #32-example-declaring-primitive-and-extended-types )
3737 - [ 4. Example: Declaring inline compound types] ( #4-example-declaring-inline-compound-types )
38- - [ 4.1. Example: Declaring reusable types in ` $defs ` ] ( #41-example-declaring-reusable-types-in-defs )
38+ - [ 4.1. Example: Declaring reusable types in ` definitions ` ] ( #41-example-declaring-reusable-types-in-defs )
3939 - [ 4.2. Example: Structuring types with namespaces] ( #42-example-structuring-types-with-namespaces )
4040 - [ 4.3. Example: Using an Array Type] ( #43-example-using-an-array-type )
4141 - [ 4.4. Example: Declaring Maps] ( #44-example-declaring-maps )
@@ -234,7 +234,7 @@ Example:
234234``` json
235235{
236236 "$schema" : " https://json-structure.github.io/meta/core/v0/#" ,
237- "$defs " : {
237+ "definitions " : {
238238 "AddressBase" : {
239239 "abstract" : true ,
240240 "type" : " object" ,
@@ -246,21 +246,21 @@ Example:
246246 },
247247 "StreetAddress" : {
248248 "type" : " object" ,
249- "$extends" : " #/$defs /AddressBase" ,
249+ "$extends" : " #/definitions /AddressBase" ,
250250 "properties" : {
251251 "street" : { "type" : " string" }
252252 }
253253 },
254254 "PostOfficeBoxAddress" : {
255255 "type" : " object" ,
256- "$extends" : " #/$defs /AddressBase" ,
256+ "$extends" : " #/definitions /AddressBase" ,
257257 "properties" : {
258258 "poBox" : { "type" : " string" }
259259 }
260260 },
261261 "Address" : {
262262 "type" : " object" ,
263- "$extends" : " #/$defs /AddressBase"
263+ "$extends" : " #/definitions /AddressBase"
264264 }
265265 }
266266}
@@ -287,11 +287,11 @@ applied to any _StreetAddress_ types in a document:
287287{
288288 "$schema" : " https://json-structure.github.io/meta/core/v0/#" ,
289289 "$id" : " https://schemas.vasters.com/Addresses" ,
290- "$root" : " #/$defs /StreetAddress" ,
290+ "$root" : " #/definitions /StreetAddress" ,
291291 "$offers" : {
292- "DeliveryInstructions" : " #/$defs /DeliveryInstructions"
292+ "DeliveryInstructions" : " #/definitions /DeliveryInstructions"
293293 },
294- "$defs " : {
294+ "definitions " : {
295295 "StreetAddress" : {
296296 "type" : " object" ,
297297 "properties" : {
@@ -304,7 +304,7 @@ applied to any _StreetAddress_ types in a document:
304304 "DeliveryInstructions" : {
305305 "abstract" : true ,
306306 "type" : " object" ,
307- "$extends" : " #/$defs /StreetAddress" ,
307+ "$extends" : " #/definitions /StreetAddress" ,
308308 "properties" : {
309309 "instructions" : { "type" : " string" }
310310 }
@@ -501,9 +501,9 @@ type cannot be referenced from other types in the schema.
501501}
502502```
503503
504- ### 4.1. Example: Declaring reusable types in ` $defs `
504+ ### 4.1. Example: Declaring reusable types in ` definitions `
505505
506- To define reusable types, you can use the ` $defs ` keyword to define types that
506+ To define reusable types, you can use the ` definitions ` keyword to define types that
507507can be referenced by other types in the same document. Here is an example:
508508
509509``` json
@@ -518,10 +518,10 @@ can be referenced by other types in the same document. Here is an example:
518518 "score" : { "type" : " int64" },
519519 "balance" : { "type" : " decimal" , "precision" : 20 , "scale" : 2 },
520520 "isActive" : { "type" : " boolean" },
521- "address" : { "type" : { "$ref" : " #/$defs /Address" } }
521+ "address" : { "type" : { "$ref" : " #/definitions /Address" } }
522522 },
523523 "required" : [" username" , " birthdate" ],
524- "$defs " : {
524+ "definitions " : {
525525 "Address" : {
526526 "type" : " object" ,
527527 "properties" : {
@@ -536,9 +536,9 @@ can be referenced by other types in the same document. Here is an example:
536536}
537537```
538538
539- In this example, the ` Address ` type is declared in the ` $defs ` section and can be
539+ In this example, the ` Address ` type is declared in the ` definitions ` section and can be
540540referenced by other types in the same document using the ` $ref ` keyword. Mind
541- that the ` $ref ` keyword can now only reference types declared in the ` $defs `
541+ that the ` $ref ` keyword can now only reference types declared in the ` definitions `
542542section of the same document. The keyword can only be used where a type is
543543expected.
544544
@@ -555,11 +555,11 @@ namespaces to structure your types, with two differing `Address` types:
555555 "properties" : {
556556 "username" : { "type" : " string" },
557557 "dateOfBirth" : { "type" : " date" },
558- "networkAddress" : { "type" : { "$ref" : " #/$defs /Network/Address" } },
559- "physicalAddress" : { "type" : { "$ref" : " #/$defs /Physical/Address" } }
558+ "networkAddress" : { "type" : { "$ref" : " #/definitions /Network/Address" } },
559+ "physicalAddress" : { "type" : { "$ref" : " #/definitions /Physical/Address" } }
560560 },
561561 "required" : [" username" , " birthdate" ],
562- "$defs " : {
562+ "definitions " : {
563563 "Network" : {
564564 "Address" : {
565565 "type" : " object" ,
@@ -623,8 +623,8 @@ To declare an array of a reusable type, you can use the `$ref` keyword:
623623{
624624 "$schema" : " https://json-structure.github.io/meta/core/v0/#" ,
625625 "type" : " array" ,
626- "items" : { "type" : { "$ref" : " #/$defs /Person" } },
627- "$defs " : {
626+ "items" : { "type" : { "$ref" : " #/definitions /Person" } },
627+ "definitions " : {
628628 "Person" : {
629629 "type" : " object" ,
630630 "name" : " Person" ,
@@ -647,8 +647,8 @@ This example shows how to declare a map of strings to `Color` objects:
647647{
648648 "$schema" : " https://json-structure.github.io/meta/core/v0/#" ,
649649 "type" : " map" ,
650- "values" : { "type" : { "$ref" : " #/$defs /Color" } },
651- "$defs " : {
650+ "values" : { "type" : { "$ref" : " #/definitions /Color" } },
651+ "definitions " : {
652652 "Color" : {
653653 "type" : " object" ,
654654 "name" : " Color" ,
0 commit comments