We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When declaring models with Enums that are nullable the generated OpenAPI 3.0 description does produce a oneOf descriminator. (see playground link).
Instead of receiving
enumProp: oneOf: - $ref: '#/components/schemas/MyEnum' nullable: true
i would expect to receive:
enumProp: allOf: - $ref: '#/components/schemas/MyEnum' nullable: true
https://typespec.io/playground?c=aW1wb3J0ICJAdHlwZXNwZWMvaHR0cCI7DQrSGnJlc3TWGm9wZW5hcGkzxB4NCnVzaW5nIFR5cGVTcGVjLlJlc3Q70RZIdHRwxS5lbnVtIE15RcQHew0KICAgIHZhbHVlMTvLDTLMDTM7DQp9xDttb2RlbCBSZXF1aXJlZE5vdE51bGxhYmxlyEnEXFByb3A6x2HXOd82IHwgbnVsbM49T3B0aW9uYWzbdj%2FIQdY53zbId8U9&e=%40typespec%2Fopenapi3&options=%7B%7D
The text was updated successfully, but these errors were encountered:
Yeah seems like a bug for other types with $ref is does make an allOf Playground
allOf
Sorry, something went wrong.
No branches or pull requests
Describe the bug
When declaring models with Enums that are nullable the generated OpenAPI 3.0 description does produce a oneOf descriminator. (see playground link).
Instead of receiving
i would expect to receive:
Reproduction
https://typespec.io/playground?c=aW1wb3J0ICJAdHlwZXNwZWMvaHR0cCI7DQrSGnJlc3TWGm9wZW5hcGkzxB4NCnVzaW5nIFR5cGVTcGVjLlJlc3Q70RZIdHRwxS5lbnVtIE15RcQHew0KICAgIHZhbHVlMTvLDTLMDTM7DQp9xDttb2RlbCBSZXF1aXJlZE5vdE51bGxhYmxlyEnEXFByb3A6x2HXOd82IHwgbnVsbM49T3B0aW9uYWzbdj%2FIQdY53zbId8U9&e=%40typespec%2Fopenapi3&options=%7B%7D
Checklist
The text was updated successfully, but these errors were encountered: