Compatibility warning
This specification extension is supported only in OpenAPI 2.0. In OpenAPI 3.0, use nullable
. In OpenAPI 3.1, use an array of types and include null
in the list.
Use x-nullable
in your OpenAPI 2.0 documents to mark schemas with the label Nullable
in the API documentation. This indicates that the value of a particular property may be null
. Add it to the schema
OpenAPI object.
Use the x-nullable
extension in an Schema object.
Option | Type | Description |
---|---|---|
x-nullable | boolean | Marks schema as a nullable. |
The following example show how to mark the country
Schema as nullable
.
swagger: '2.0'
schemas:
country:
type: string
description: Country of origin
x-nullable: true
- Migration notes from OpenAPI 3.0 to 3.1 - Learn about nullable changes and migration considerations between OpenAPI versions
- Show extensions configuration - Control which extensions are included in your API reference documentation for optimal presentation
- OpenAPI configuration settings - Complete reference for all available OpenAPI configuration options and customization settings
- Supported OpenAPI extensions - Complete list of all OpenAPI extensions supported by Redocly for enhanced API documentation