1
내가 여러 개의 입력과의 데이터 필드를 가지고 :Json Schema - 혼합 된 필드를 표현하는 방법 Types (문자열 및 객체)?
그것은 스키마가 유형 = 문자열이 될 수 :
{"mixed_field" : {"type":"string"} }
다른 시간이 될 수있는 유형 = 개체가 스키마의 모습을 :
{"mixed_field" : {
"properties": {
"access_token": {
"type": "string"
},
"created_at": {
"type": "integer"
}
},
"type": "object"
}
}
"mixed_field"는 유형 문자열 또는 유형 객체가 될 수 있다고 어떻게 표현합니까? 다음과 같이 "oneOf"키워드를 사용해야합니까?
{
"mixed_field": {
"oneOf": [
{
"type": "string"
},
{
"properties": {
"access_token": {
"type": "string"
},
"created_at": {
"type": "integer"
}
},
"type": "object"
}
]
}
}
유형이 원시적 인 경우 '속성'이 무시된다는 것을 알지 못했습니다! 머리를 가져 주셔서 감사합니다. oneOf 키워드를 사용하는 것보다 유형 필드를 열거하는 것보다 특정한 기본 설정이 있습니까? – pl0u