Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sashalikesplanes/bd015e9538596c1373f48d9ef8ce69ff to your computer and use it in GitHub Desktop.
Save sashalikesplanes/bd015e9538596c1373f48d9ef8ce69ff to your computer and use it in GitHub Desktop.
test2.json
{
"$schema": "http://json-schema.org/draft-07/hyper-schema#",
"type": "object",
"definitions": {
"user": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": ["id", "name"]
}
},
"properties": {
"user": {
"$ref": "#/definitions/user"
}
},
"links": [
{
"rel": "create",
"href": "/users",
"method": "POST",
"title": "Create User",
"schema": {
"type": "object",
"properties": {
"userName": {
"type": "string"
},
"userId": {
"type": "string"
}
},
"required": ["userName", "userId"]
},
"targetSchema": {
"$ref": "#/definitions/user"
},
"mapping": {
"userName": "name",
"userId": "id"
}
},
{
"rel": "self",
"href": "/users/{id}",
"method": "GET",
"title": "Get User",
"targetSchema": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": ["name", "id"]
},
"mapping": {
"name": "name",
"id": "id"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment