Last active
August 29, 2018 23:43
-
-
Save TakashiSasaki/6570831 to your computer and use it in GitHub Desktop.
「特定の文字列もしくはnullを取る」をJSONスキーマで表現する。
http://jsonschemalint.com/ で検証済み。ただし JSON Schema Draft v3。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "object", | |
"properties": { | |
"x": { | |
"type": [ | |
"string", | |
"null" | |
], | |
"required": false, | |
"enum": [ | |
"a", | |
"b", | |
null | |
] | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"x": null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment