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
Describe the solution you'd like x-nullable is a very common vendor extension that allows expressing nullabilty in an OpenAPI 2.0 schema. Tools such as swagger-codegen and openapi-generator can use this to preserve this type information into the generated code. This is important when exposing database columns that can be NULL.
Describe the solution you'd like
x-nullable
is a very common vendor extension that allows expressing nullabilty in an OpenAPI 2.0 schema. Tools such asswagger-codegen
andopenapi-generator
can use this to preserve this type information into the generated code. This is important when exposing database columns that can beNULL
.The DjangoRestFramework ecosystem has support for this.
Using
x-nullable
, would change the generated TypeScript fromto
The client code can then use type checking to ensure that
null
is properly checked before accessing the content.This could be done by adding an optional
nullable
keyword argument to fields, for example:The text was updated successfully, but these errors were encountered: