Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Implement unevaluatedProperties #1122

Open
AtosNicoS opened this issue Jan 23, 2020 · 2 comments
Open

[Feature Request] Implement unevaluatedProperties #1122

AtosNicoS opened this issue Jan 23, 2020 · 2 comments

Comments

@AtosNicoS
Copy link

AtosNicoS commented Jan 23, 2020

What I want to do is basically this:
json-schema-org/json-schema-spec#661

I want to inherit from a schema, add some more properties and disallow additional properties. Setting additionalProperties to false will not work combined with allOf. For that reason unevaluatedProperties was introduced, as you can see in the linked issue. But it does not seem to be implemented by njsonschema yet.

Edit: This was introduced in v8/2019-09 as far as I know.

@IanKemp
Copy link

IanKemp commented Nov 19, 2021

Just bumped my head against this. unevaluatedProperties is apparently supposed to solve the problem whereby you cannot use inheritance (additionalProperties = false together with allOf) so it would be great to have this implemented.

That said, JsonSchemaSettings currently has the FlattenInheritanceHierarchy member which you can set to true to work around most of these issues. I do wish the documentation around this property was better, because it defaults to false and it's critical to set it to true any time you're dealing with C# POCOs that use any form of inheritance.

@RicoSuter
Copy link
Owner

Makes sense to add.
As this library is mostly used for OpenAPI this has not much prio for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants