Skip to content

Commit

Permalink
schemas: make registration post more strictly defined
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbonney committed Mar 6, 2017
1 parent 5cd7c33 commit fcf2038
Showing 1 changed file with 72 additions and 17 deletions.
89 changes: 72 additions & 17 deletions APIs/schemas/registrationapi-v1.0-resource-post-request.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,78 @@
"type",
"data"
],
"properties": {
"type": {
"description": "Singular form of the resource type to be registered (e.g. node, source, flow etc)",
"type": "string",
"enum": ["node", "device", "sender", "receiver", "source", "flow"]
"oneOf": [
{
"properties": {
"type": {
"description": "Singular form of the resource type to be registered",
"type": "string",
"enum": ["node"]
},
"data": {
"$ref": "node.json"
}
}
},
"data": {
"description": "Object containing the full representation of the Node, Source, Flow, Device etc.",
"type": "object",
"anyOf": [
{"$ref": "node.json"},
{"$ref": "device.json"},
{"$ref": "source.json"},
{"$ref": "flow.json"},
{"$ref": "sender.json"},
{"$ref": "receiver.json"}
]
{
"properties": {
"type": {
"description": "Singular form of the resource type to be registered",
"type": "string",
"enum": ["device"]
},
"data": {
"$ref": "device.json"
}
}
},
{
"properties": {
"type": {
"description": "Singular form of the resource type to be registered",
"type": "string",
"enum": ["sender"]
},
"data": {
"$ref": "sender.json"
}
}
},
{
"properties": {
"type": {
"description": "Singular form of the resource type to be registered",
"type": "string",
"enum": ["receiver"]
},
"data": {
"$ref": "receiver.json"
}
}
},
{
"properties": {
"type": {
"description": "Singular form of the resource type to be registered",
"type": "string",
"enum": ["source"]
},
"data": {
"$ref": "source.json"
}
}
},
{
"properties": {
"type": {
"description": "Singular form of the resource type to be registered",
"type": "string",
"enum": ["flow"]
},
"data": {
"$ref": "flow.json"
}
}
}
}
]
}

0 comments on commit fcf2038

Please sign in to comment.