Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The smallest number of schema changes required to support transports extensibility #177

Open
wants to merge 8 commits into
base: v1.2-dev
Choose a base branch
from
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": "Constraints on transport parameters for another transport defined in Transports register of the NMOS Parameter Registers",
"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": "Transport-specific parameters for another transport defined in Transports register of the NMOS Parameter Registers",
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9_]+$": {
"type": [
"string",
"boolean",
"null",
"number"
]
garethsb marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
}
]
}
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": "Transport-specific parameters for another transport defined in Transports register of the NMOS Parameter Registers",
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9_]+$": {
"type": [
"string",
"boolean",
"null",
"number"
]
garethsb marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
}
]
}
13 changes: 12 additions & 1 deletion APIs/schemas/transporttype-response-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,25 @@
"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"
]
},
{
"description": "Any transport type URN base defined by an AMWA specification in the Transports register of the NMOS Parameter Registers",
"type": "string",
"pattern": "^urn:x-nmos:transport:[^./]+$"
},
{
"description": "Any manufacturer-specific transport type URN base defined in the Transports register of the NMOS Parameter Registers",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we expect manufacturer namespaces to be registered in the transports register? I feel this whole area is thin in terms of interoperability. What would a controller be expected to do when it encounters a manufacturer namespace?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would assume that the controller then check if it knows about this transport and then use the vendor specific schemas about such transport. There may be an issue if multiple vendors claim the same namespace ...

"not": {
"pattern": "^urn:x-nmos:"
}
}
],
"format": "uri"
Expand Down
Loading