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
Given the following smithy model:
$version: "2.0" namespace api use alloy#nullable enum MyEnum { CASE_1 CASE_2 } structure MyDto { @nullable enum: MyEnum }
We get the following openapi defintion
{ "MyDto": { "type": "object", "properties": { "enum": { "$ref": "#/components/schemas/MyEnum" } } }, "MyEnum": { "type": "string", "enum": [ "CASE_1", "CASE_2" ] } }
In the spec the nullability of the enum is missing. This happens because $ref and nullable are incompatible.
$ref
nullable
Generate the spec using oneOf e.g.
oneOf
{ "enum": { "oneOf": [ { "$ref": "#/components/schemas/MyEnum" }, { "type": "null" } ] } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Problem
Given the following smithy model:
We get the following openapi defintion
In the spec the nullability of the enum is missing. This happens because
$ref
andnullable
are incompatible.Proposed solution
Generate the spec using
oneOf
e.g.The text was updated successfully, but these errors were encountered: