Problem with "oneOf"
See original GitHub issueHere is a scheme I am trying to use…
{
"title": "Configuration",
"type": "object",
"properties": {
"triggers": {
"type": "array",
"format": "tabs",
"title": "Triggers",
"items": {
"title": "Trigger",
"oneOf": [
{
"title": "Twitter",
"type": "object",
"properties": {
"track": {
"type": "string"
}
}
},
{
"title": "Instagram",
"type": "object",
"properties": {
"tags": {
"title": "Tags",
"type": "array",
"format": "table",
"items": {
"title": "tag",
"type": "string"
}
}
}
}
]
}
}
}
}
In the editor, If I switch an “Trigger” from “Twitter” to “Instagram”, I still see a property from the Twitter schema (“track”). I don’t think that should be displaying at all, but it is also not displaying correctly. Is this a bug? In any case is there any way to get around this problem?
In the dropdown, change twitter to instagram.
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
[BUG][Java] OneOf-Class not generated #10880 - GitHub
It looks as if there's a problem with oneOf support for properties; as the summary indicates, the generator fails to generate the appropriate ......
Read more >OpenAPI models not being generated when using oneOf
I have oneOf generation working for java using openapi-generator 5.4. 0 but I do add a discriminator field (like requestType: type: string enum ......
Read more >OneOf, nested inside of another OneOf is not shown...
Hello,. I am developing a Spring app with OpenApi. For open API spec (schema.txt) java code is generated by the maven code generator...
Read more >oneOf rendered as pulldown in API Reference
My expectation is that both of the objects would be rendered with a notation indicating "oneOf", or a pulldown with the objects' descriptions...
Read more >Problem with oneOf enum in angular (jsonforms) - Reddit
Problem with oneOf enum in angular (jsonforms). Hello guys,. I use the JSON Forms library with Angular, JSON Forms allows me to define...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s not a bug, but it is really unintuitive behavior. By default, JSON Editor tries to keep the value of
oneOf
fields when you switch between schemas if possible.You can fix this in one of two ways:
track
property invalid for your Instagram oneOf schema by settingadditionalProperties
to false.keep_oneof_values
to false during initialization.@akshitjain Wut?