Skip to content

Commit

Permalink
feat: #comment shifted location-identifier to central definition in c…
Browse files Browse the repository at this point in the history
…ore schema
  • Loading branch information
scrthq committed Nov 2, 2024
1 parent 815401f commit d05d3f9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://raw.githubusercontent.com/opensupplyhub/supplychaindata.exchange/refs/heads/main/schema/core-schema.json",
"$schema": "../../../schema/core-schema.json",
"locations": [
{
"guid": "82d39ac8-1a12-4801-835a-85d319927548",
Expand Down
2 changes: 1 addition & 1 deletion examples/full/valid/core-schema-example.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://raw.githubusercontent.com/opensupplyhub/supplychaindata.exchange/refs/heads/main/schema/core-schema.json",
"$schema": "../../../schema/core-schema.json",
"locations": [
{
"guid": "82d39ac8-1a12-4801-835a-85d319927548",
Expand Down
17 changes: 10 additions & 7 deletions schema/core-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,12 @@
"description": "Accepted location identifier, which can be a single string (e.g., 'osid:XXXXXXXX', 'gfid:XXXXXXXX') or an array of such strings (osid stands for open supply hub ID, and gfid for Global Field ID)",
"anyOf": [
{
"type": "string",
"pattern": "^(osid|gfid):[A-Za-z0-9]+$",
"description": "A single location identifier string with a specific prefix (e.g., 'osid:' or 'gfid:')"
"$ref": "#/definitions/location-identifier"
},
{
"type": "array",
"items": {
"type": "string",
"pattern": "^(osid|gfid):[A-Za-z0-9]+$",
"description": "Each item in the array must be a location identifier string with a specific prefix"
"$ref": "#/definitions/location-identifier"
},
"minItems": 1,
"description": "An array of location identifier strings"
Expand Down Expand Up @@ -259,5 +255,12 @@
},
"required": [
"locations"
]
],
"definitions": {
"location-identifier": {
"type": "string",
"pattern": "^(osid|gfid):[A-Za-z0-9]+$",
"description": "A location identifier string with a specific prefix (e.g., 'osid:', 'gfid:')"
}
}
}

0 comments on commit d05d3f9

Please sign in to comment.