有时,我注意到以下JSON模式:
{
"type": "object",
"properties": {
"address": {
"type": "string",
"required": true
}
}
}
vs
{
"type": "object",
"properties": {
"address": {
"type": "string",
"optional": false
}
}
}
那么在上面的例子中,required
和optional
之间有什么不同呢?