Set additionalProperties to false for Unions #4316
Answered
by
timotheeguerin
Devon-White
asked this question in
Json Schema
-
I have the following TypeSpec union: union SWMLMethod {
Answer,
Cond,
Denoise,
Execute,
Goto,
Label,
If,
Hangup,
JoinRoom,
Play,
Prompt,
ReceiveFax,
global.Record,
RecordCall,
Request,
Return,
SendDigits,
SendFax,
SendSMS,
Set,
Sleep,
SIPRefer,
StopDenoise,
StopRecordCall,
StopTap,
Switch,
Tap,
Transfer,
Unset,
NoArgSWMLMethod
} Is there anyway to force this to have When using a Monaco editor, if this is not specified in the schema, it will allow for additionalProperties. It's easy to go back and add, but would be helpful if I could just state it to false on the Union. The Json schmea is generated like such: "SWMLMethod": {
"anyOf": [
{
"$ref": "#/$defs/Answer"
},
{
"$ref": "#/$defs/Cond"
},
{
"$ref": "#/$defs/Denoise"
},
{
"$ref": "#/$defs/Execute"
},
{
"$ref": "#/$defs/Goto"
},
{
"$ref": "#/$defs/Label"
},
{
"$ref": "#/$defs/If"
},
{
"$ref": "#/$defs/Hangup"
},
{
"$ref": "#/$defs/JoinRoom"
},
{
"$ref": "#/$defs/Play"
},
{
"$ref": "#/$defs/Prompt"
},
{
"$ref": "#/$defs/ReceiveFax"
},
{
"$ref": "#/$defs/Record"
},
{
"$ref": "#/$defs/RecordCall"
},
{
"$ref": "#/$defs/Request"
},
{
"$ref": "#/$defs/Return"
},
{
"$ref": "#/$defs/SendDigits"
},
{
"$ref": "#/$defs/SendFax"
},
{
"$ref": "#/$defs/SendSMS"
},
{
"$ref": "#/$defs/Set"
},
{
"$ref": "#/$defs/Sleep"
},
{
"$ref": "#/$defs/SIPRefer"
},
{
"$ref": "#/$defs/StopDenoise"
},
{
"$ref": "#/$defs/StopRecordCall"
},
{
"$ref": "#/$defs/StopTap"
},
{
"$ref": "#/$defs/Switch"
},
{
"$ref": "#/$defs/Tap"
},
{
"$ref": "#/$defs/Transfer"
},
{
"$ref": "#/$defs/Unset"
},
{
"$ref": "#/$defs/NoArgSWMLMethod"
}
]
}, |
Beta Was this translation helpful? Give feedback.
Answered by
timotheeguerin
Sep 3, 2024
Replies: 1 comment 1 reply
-
I don't believe we can today, feel free to file an issue. Not sure this should be limited to oneOf too |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Devon-White
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't believe we can today, feel free to file an issue. Not sure this should be limited to oneOf too