Closed jolla56 closed 1 year ago
The issue seemed solved in json schema 2019-09
Alternative proposal in earlier schema versions: { "anyOf": [ { "type": "object", "properties": { "a": { "type": "string" } } }, { "type": "object", "properties": { "x": { "type": "string" } } } ], "properties": { "a": true, "x": true }, "additionalProperties": false }
But I suspect this implies listing all the properties in the bottom part.
Another alternative would be to add name to the core schema, but I don't like that either. We have talked about moving to a newer schema version, so this might be the reason to do so.
And now when I test I can't repeat the problem.
Brendan could replicate the bug in unit tests. And when working more with oXygen I can verify that the problem is there. oXygen seem to demand that you have a validated copy before testing. Because if it is marked as wrong it seems to stay that way even if you switch schema to validate against.
@jolla56 has tried to get this working using unevaluatedProperties:false
which is a feature of JSON SChema 2019 and onwards. But it doesn't seem to be working - hopefully with some advice we can get it going.
After looking at this at today's meeting, we concluded that we have three alternatives, and this is our preferred order of solving the problem:
unevaluatedProperties:false
to work"name": "...", "newsitem": {}
- but this is a breaking change so would require bumping the version number to 3.0.Update: after the meeting, @jeremybrooks solved the JSON Schema problem so we can go with solution 1 above!
We might have an issue with associations and additional properties = false. When I created a sample from a ver 1.3 ninjs it still accepted the description_text thing but should really have complained because in 2.x it should be descriptions: [array].
My quick googling gave the answer that it is hard to combine anyOf with additionalProperties=false.