Skip to content

Instantly share code, notes, and snippets.

@itolosa
Last active March 18, 2021 20:54
Show Gist options
  • Save itolosa/43c20a1bac2d77cacbdea17befef214a to your computer and use it in GitHub Desktop.
Save itolosa/43c20a1bac2d77cacbdea17befef214a to your computer and use it in GitHub Desktop.
Json Schema generated from Google JSON Style Guide orderly syntax
{
"type": "object",
"properties": {
"apiVersion": {
"type": "string"
},
"context": {
"type": "string"
},
"id": {
"type": "string"
},
"method": {
"type": "string"
},
"params": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
}
},
"data": {
"type": "object",
"properties": {
"kind": {
"type": "string"
},
"fields": {
"type": "string"
},
"etag": {
"type": "string"
},
"id": {
"type": "string"
},
"lang": {
"type": "string"
},
"updated": {
"type": "string"
},
"deleted": {
"type": "boolean"
},
"currentItemCount": {
"type": "integer"
},
"itemsPerPage": {
"type": "integer"
},
"startIndex": {
"type": "integer"
},
"totalItems": {
"type": "integer"
},
"pageIndex": {
"type": "integer"
},
"totalPages": {
"type": "integer"
},
"pageLinkTemplate": {
"type": "string",
"pattern": "^https?:"
},
"next": {
"type": "object"
},
"nextLink": {
"type": "string"
},
"previous": {
"type": "object"
},
"previousLink": {
"type": "string"
},
"self": {
"type": "object"
},
"selfLink": {
"type": "string"
},
"edit": {
"type": "object"
},
"editLink": {
"type": "string"
},
"items": {
"type": "array",
"items": {
"type": "object"
},
"additionalItems": false,
"minItems": 1
}
}
},
"error": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"errors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"domain": {
"type": "string"
},
"reason": {
"type": "string"
},
"message": {
"type": "string"
},
"location": {
"type": "string"
},
"locationType": {
"type": "string"
},
"extendedHelp": {
"type": "string"
},
"sendReport": {
"type": "string"
}
}
},
"minItems": 1,
"additionalItems": false
}
}
}
},
"anyOf": [{ "required": [ "data" ] }, { "required": [ "error" ] }]
}
object {
string apiVersion?;
string context?;
string id?;
string method?;
object {
string id?
}* params?;
object {
string kind?;
string fields?;
string etag?;
string id?;
string lang?;
string updated?; # date formatted RFC 3339
boolean deleted?;
integer currentItemCount?;
integer itemsPerPage?;
integer startIndex?;
integer totalItems?;
integer pageIndex?;
integer totalPages?;
string pageLinkTemplate /^https?:/ ?;
object {}* next?;
string nextLink?;
object {}* previous?;
string previousLink?;
object {}* self?;
string selfLink?;
object {}* edit?;
string editLink?;
array [
object {}*
] items?;
}* data?;
object {
integer code?;
string message?;
array [
object {
string domain?;
string reason?;
string message?;
string location?;
string locationType?;
string extendedHelp?;
string sendReport?;
}*
] errors?;
}* error?;
}*;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment