Skip to content

Instantly share code, notes, and snippets.

@TakashiSasaki
Last active August 29, 2018 23:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TakashiSasaki/6570831 to your computer and use it in GitHub Desktop.
Save TakashiSasaki/6570831 to your computer and use it in GitHub Desktop.
「特定の文字列もしくはnullを取る」をJSONスキーマで表現する。 http://jsonschemalint.com/ で検証済み。ただし JSON Schema Draft v3。
{
"type": "object",
"properties": {
"x": {
"type": [
"string",
"null"
],
"required": false,
"enum": [
"a",
"b",
null
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment