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

Fixes for internally tagged enums and flattening additional_properties #113

Merged
merged 1 commit into from Nov 25, 2021

Conversation

ahl
Copy link
Contributor

@ahl ahl commented Oct 8, 2021

Flattening has some surprising outcomes when it comes to the additional_properties field. Consider that None is equivalent to Some(Schema::Bool(true)); merge currently prefers any Some to any None irrespective of the contents. Given the context of merge/flatten, the result of merging two additional_field values should be the union of the two schemas i.e. the schema that validates either.

This is particularly relevant for internally tagged schemas where currently additional properties are allowed even when deny_unknown_fields is set and can be constrained e.g. when a variant such as StringMap(Map<&'static str, &'static str>), is present.

they might.

flatten doesn't act quite as intended with regard to
additional_properties
@ahl
Copy link
Contributor Author

ahl commented Nov 15, 2021

@GREsau could I ask you to take a look at this?

@GREsau GREsau merged commit 98ad162 into GREsau:master Nov 25, 2021
@GREsau
Copy link
Owner

GREsau commented Nov 25, 2021

Thanks, this is now published in v0.8.8 :)

@ahl ahl deleted the internal branch November 29, 2021 17:30
@ahl ahl mentioned this pull request Dec 6, 2021
ahl added a commit to oxidecomputer/typify that referenced this pull request Dec 6, 2021
ahl added a commit to oxidecomputer/typify that referenced this pull request Dec 6, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants