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

discuss: refs in discriminator object #1021

Open
jgresty opened this issue Oct 16, 2024 · 1 comment
Open

discuss: refs in discriminator object #1021

jgresty opened this issue Oct 16, 2024 · 1 comment

Comments

@jgresty
Copy link

jgresty commented Oct 16, 2024

I have noticed that while the upstream openapi 3 spec for discriminator object specifies the data type is Map[string]string, in their written examples they use refs: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#discriminator-object

While this library sticks to the literal spec type definition, we have noticed many real world specs which do accept refs in this field. Since even the upstream spec is not well defined here perhaps this library should be more lax?

Curious to hear opinions about this. I have also raised an issue upstream about this: OAI/OpenAPI-Specification#4138

@jgresty
Copy link
Author

jgresty commented Oct 16, 2024

So from upstream the typing is correct as reference objects also use type string for their referenced strings.

In this case I think the discriminator mapping object needs to be considered in functions such as InternalizeRefs and Validate

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

1 participant