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

Generate anyOf schema for oneOfVariants with the same status code and content-type #3703

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

susliko
Copy link
Contributor

@susliko susliko commented Apr 19, 2024

Fixes #3660

Chose to use anyOf (not oneOf) because there's no discriminator and we cannot guarantee that only one model will match.

@susliko susliko force-pushed the scame-ct-oneof-variants branch from cb2bda3 to e8fc8ad Compare April 19, 2024 09:25
@adamw
Copy link
Member

adamw commented Apr 19, 2024

@ghik approves of using anyOf vs oneOf :)

Thanks! Just waiting for the build to finish

Comment on lines +115 to +116
example = bodies.flatMap(_.example).headOption,
examples = bodies.flatMap(_.examples).toListMap
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

example and examples are mutually exclusive, we should fill only one of them

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the problem might be present elsewhere as well, however we probably only ever generate example based on tapir's schemas. Let's move it to another issue

@adamw adamw merged commit d8c700c into softwaremill:master Apr 19, 2024
23 checks passed
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.

Schema of oneOf variants with same status code and content-type
3 participants