You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today, if I use the following Smithy enum definition:
@documentation("The status of the enrollment request.")
enumEnrollmentStatus {
@documentation("The enrollment request is pending review.")
PENDING="PENDING",
@documentation("The enrollment request has been approved.")
APPROVED="APPROVED",
@documentation("The enrollment request has been rejected.")
REJECTED="REJECTED"
}
The following OpenAPI output will be produced, as can be seen below, the per item documentation lines are lost:
{
"EnrollmentStatus": {
"type": "string",
"description": "The status of the enrollment. Only Stedi can set or update this property.",
"enum": [
"PENDING",
"APPROVED",
"REJECTED"
]
}
}
Using OAS 3.1.x (and JSON Schema 2020-12) enums can be defined with oneOf along with const to allow documentation to included for each item, for example:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "The status of the enrollment request.",
"oneOf": [
{
"const": "PENDING",
"description": "The enrollment request is pending."
},
{
"const": "APPROVED",
"description": "The enrollment request has been approved."
},
{
"const": "REJECTED",
"description": "The enrollment request has been rejected."
}
]
}
}
}
It would be great if we could have the same support in the openapi plugin.
The text was updated successfully, but these errors were encountered:
Today, if I use the following Smithy enum definition:
The following OpenAPI output will be produced, as can be seen below, the per item documentation lines are lost:
Using OAS 3.1.x (and JSON Schema 2020-12) enums can be defined with
oneOf
along withconst
to allow documentation to included for each item, for example:It would be great if we could have the same support in the openapi plugin.
The text was updated successfully, but these errors were encountered: