Skip to content

Commit

Permalink
The smallest number of schema changes required to support transports …
Browse files Browse the repository at this point in the history
…extensibility
  • Loading branch information
cristian-recoseanu committed Dec 4, 2024
1 parent 0554348 commit 6f732cb
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 9 deletions.
15 changes: 14 additions & 1 deletion APIs/schemas/constraints-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Used to express the dynamic constraints on transport parameters. These constraints may be set and changed at run time. Parameters must also conform with constraints inferred from the specification. Every transport parameter must have an entry, even if it is only an empty object.",
"title": "Constraints",
"anyOf": [{
"anyOf": [
{
"type": "array",
"items": {
"$ref": "constraints-schema-rtp.json"
Expand All @@ -19,6 +20,18 @@
"items": {
"$ref": "constraints-schema-mqtt.json"
}
},
{
"type": "array",
"items": {
"description": "Any other definition for transports registered in the parameter register",
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9_]+$": {
"$ref": "constraint-schema.json#/definitions/constraint"
}
}
}
}
]
}
20 changes: 19 additions & 1 deletion APIs/schemas/receiver_transport_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Transport-specific parameters. If this parameter is included in a client request it must include the same number of array elements (or 'legs') as specified in the constraints. If no changes are required to a specific leg it must be included as an empty object ({}).",
"title": "Receiver Transport Parameters",
"anyOf": [{
"anyOf": [
{
"type": "array",
"items": {
"$ref": "receiver_transport_params_rtp.json"
Expand All @@ -25,6 +26,23 @@
"items": {
"$ref": "receiver_transport_params_mqtt.json"
}
},
{
"type": "array",
"items": {
"description": "Any other definition for transports registered in the parameter register",
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9_]+$": {
"type": [
"string",
"boolean",
"null",
"number"
]
}
}
}
}
]
}
20 changes: 19 additions & 1 deletion APIs/schemas/sender_transport_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Transport-specific parameters. If this parameter is included in a client request it must include the same number of array elements (or 'legs') as specified in the constraints. If no changes are required to a specific leg it must be included as an empty object ({}).",
"title": "Sender Transport Parameters",
"anyOf": [{
"anyOf": [
{
"type": "array",
"items": {
"$ref": "sender_transport_params_rtp.json"
Expand All @@ -25,6 +26,23 @@
"items": {
"$ref": "sender_transport_params_mqtt.json"
}
},
{
"type": "array",
"items": {
"description": "Any other definition for transports registered in the parameter register",
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9_]+$": {
"type": [
"string",
"boolean",
"null",
"number"
]
}
}
}
}
]
}
21 changes: 15 additions & 6 deletions APIs/schemas/transporttype-response-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,23 @@
"title": "Transport Type",
"description": "Transport type URN base used by the Sender or Receiver (i.e. with any subclassifications or versions removed)",
"type": "string",
"oneOf": [
"anyOf": [
{
"enum": [
"urn:x-nmos:transport:rtp",
"urn:x-nmos:transport:dash",
"urn:x-nmos:transport:websocket",
"urn:x-nmos:transport:mqtt"
"oneOf": [
{
"enum": [
"urn:x-nmos:transport:rtp",
"urn:x-nmos:transport:dash",
"urn:x-nmos:transport:websocket",
"urn:x-nmos:transport:mqtt"
]
}
]
},
{
"description": "Any transport registered in the parameter register",
"type": "string",
"pattern": "^urn:x-nmos:transport:[a-zA-Z0-9_]+$"
}
],
"format": "uri"
Expand Down

0 comments on commit 6f732cb

Please sign in to comment.