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
This generates the following OpenAPI specification, which violates the Redoc rule spec.
The `type` field must be defined when the `nullable` field is used.
In this case, the error occurs because the nullable field is used without defining the type explicitly within the oneOf clause, which Redoc requires for proper validation.
Discussed in #4543
Originally posted by akishichinibu September 26, 2024
https://typespec.io/playground?c=c2NhbGFyIE15U3RyIGV4dGVuZHMgc3RyaW5nOwoKbW9kZWwgQSB7CiAgeDrHJnwgbnVsbAp9Cg%3D%3D&e=%40typespec%2Fopenapi3&options=%7B%7D
Consider the following TypeSpec definition:
This generates the following OpenAPI specification, which violates the Redoc rule
spec.In this case, the error occurs because the
nullablefield is used without defining thetypeexplicitly within theoneOfclause, which Redoc requires for proper validation.How can I fix this?