Skip to content

Commit ffb630a

Browse files
committed
14-schemas: Using oneOf rather than anyOf for titled enumerations
- This is the recommendation from json-schema-org/json-schema-spec#57 (comment)
1 parent cf37e02 commit ffb630a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

collections/clause_14_schemas.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,12 @@ The next example is the schema of a land cover collection.
240240
"title" : "Land Cover",
241241
"type" : "integer",
242242
"x-ogc-propertySeq" : 1,
243-
"anyOf": [
243+
"oneOf": [
244244
{ "const": 0 },
245245
{ "const": 1, "title": "vegetation" },
246246
{ "const": 2, "title": "bare soils" },
247247
{ "const": 3, "title": "water" },
248-
{ "const": 4, "title": "clouds" },
248+
{ "const": 4, "title": "clouds" }
249249
],
250250
"x-ogc-nilValues": [
251251
{ "const": 0, "title": "no data" }

collections/recommendations/schemas/REC_properties.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
^|F |For string properties, "minLength", "maxLength", "enum" and/or "pattern" SHOULD be provided, where applicable.
1111
^|G |For numeric properties, "multipleOf", "minimum", "exclusiveMinimum", "maximum", "exclusiveMaximum" SHOULD be provided, where applicable.
1212
^|H |For integer properties that represent enumerated values without providing a description for each, "enum" SHOULD be provided.
13-
^|I |For integer properties that represent enumerated values while providing a description for each, "anyOf" with a combination of "const" and "title" for each entry SHOULD be provided.
13+
^|I |For integer properties that represent enumerated values while providing a description for each, "oneOf" with a combination of "const" and "title" for each entry SHOULD be provided.
1414
^|J |For array properties, the property SHOULD consist of items that are strings or numbers.
1515
^|K |Required properties SHOULD be included in "required".
1616
^|L |The JSON Schema keywords SHOULD be constrained to those mentioned in this recommendation, requirement `/req/{req-class}/properties` and requirements in the _additional keywords_ section below.

0 commit comments

Comments
 (0)