You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/schema/conformance_and_extensions.md
+28-18Lines changed: 28 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,29 +27,39 @@ The schema for the standard by default allows for new fields, and does not fail
27
27
28
28
Conformant extensions should respect the following guidelines:
29
29
30
-
### Core fields
30
+
### Changes to existing fields
31
31
32
-
* Extensions *should not* delete fields from the core schema
33
-
* Extensions *should not* change the properties of fields from the core schema. If an extension desires to document further usage of a core standard field, it should do so through documentation, rather than changing the field's `description` property.
32
+
A conformant extension *should not*:
34
33
35
-
### Structure
34
+
* Delete properties or definitions from the OCDS schema.
35
+
* Change the value of keywords in the OCDS schema. If an extension desires to document further usage of a field in the OCDS, it should do so through documentation, rather than changing the field's `description` keyword.
36
36
37
-
* All definitions and properties *must* set a `title`, `description` and `type`, unless they are originally defined in the core schema or in another extension in which case they *must* set a `$ref` to the existing object
38
-
* If a field's `type` is "array", `items`*must* be set
39
-
* If using `items`, its `type`*must* only include "array", "number" and/or "string"
40
-
* If an array field's `wholeListMerge` and `omitWhenMerged` properties are not used or are set to `false`, the object fields under it *must* have an `id` field and this `id` field *must* be required
37
+
### New fields
38
+
39
+
A conformant extension *must*:
40
+
41
+
* Set the `title`, `description` and `type` keywords for all new definitions and properties
42
+
* Set `$ref` for fields that reuse a definition in the OCDS schema.
43
+
* Set the `items` keyword for properties of `type` "array"
44
+
* Not include types other than "array", "number" and/or "string" in the `types` keyword under an `items` keyword.
45
+
* Ensure that any definition referenced in a property of `type` array, whose `wholeListMerge` and `omitWhenMerged` keywords are unset or set to `false`, has a required `id` property.
41
46
42
47
### Codelists
43
48
44
-
* If `openCodelist` is `true`, `enum`*must not* be set
45
-
* If `openCodelist` is `false`, `enum`*must* be set
46
-
* If a field has an `enum`, this *must* be expressed as a csv codelist
47
-
* If a field has an `enum`, `codelist` and `openCodelist`*must* be set
48
-
* If adding codes to an existing codelist the codelist filename *must* append `+` to the start of the core codelist filename, for example `+documentType.csv`
49
+
A conformant extension *must*:
50
+
51
+
* Set `enum` for properties with `openCodelist` set to `false`
52
+
* Not set `enum` for properties with `openCodelist` set to `true`
53
+
* Set `codelist` and `openCodelist` for properties that set `enum`.
54
+
* Document titles and descriptions for `enum` values as a CSV codelist.
55
+
* Append "+" to the start of the codelist filename when adding codes to an existing codelist, e.g. `+documentType.csv`.
56
+
57
+
### Naming conventions
58
+
59
+
A conformant extension *must*:
49
60
50
-
### Field and code names
61
+
* Use lowerCamelCase for property names, e.g. `tenderPeriod`
62
+
* Use UpperCamelCase for definition names, e.g. `RelatedProcess`
63
+
* Use only ASCII alphabetical letters for property and definition names
51
64
52
-
* Definition names *must* be UpperCamelCase
53
-
* Field names *must* be lowerCamelCase
54
-
* Definition and field names *must* contain only ASCII alphabetical letters
55
-
* If an acronym is used within a field or definition name, the acronym *should* be all UPPERCASE, unless it is at the beginning of the name, in which case it *should* be all lowercase.
65
+
A conformant extension *should* use UPPERCASE for acronyms within property or definition names, unless the acronym is at the beginning of the name, in which case it *should* be all lowercase.
0 commit comments