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
According to OpenAPI Specification maintainers (1, 2), nullable enums are defined as shown above. That is, the schema should have nullable: true AND also include null (not "null") in the list of enum values.
The issue is that the editor flags the null value and says "enum value should conform to its schema's type". But in this example, null does conform to the schema type, because nullable: true acts as a type modifier.
Expected behavior
null in the definition above should NOT trigger warnings.
The text was updated successfully, but these errors were encountered:
hkosova
changed the title
Enum validation flags null values in nullable enums
Enum validation should not flag null values in nullable enums
Jan 31, 2020
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition:
Describe the bug you're encountering
This is a follow-up to PR #2079.
According to OpenAPI Specification maintainers (1, 2), nullable enums are defined as shown above. That is, the schema should have
nullable: true
AND also includenull
(not"null"
) in the list of enum values.The issue is that the editor flags the
null
value and says "enum value should conform to its schema's type". But in this example,null
does conform to the schema type, becausenullable: true
acts as atype
modifier.Expected behavior
null
in the definition above should NOT trigger warnings.The text was updated successfully, but these errors were encountered: