OpenAPI node types
Redocly CLI uses node types to target custom rules and custom plugins.
The node types naming convention maps to the OpenAPI specification.
This document is for OpenAPI 3.0 and OpenAPI 3.1, which mostly share the same node type tree.
The root of the OpenAPI definition is the Root
node type.
For technical details on the implementation of types for each OAS version, consult the source files in the Redocly CLI repository:
- OAS 3.1: https://github.com/Redocly/redocly-cli/blob/main/packages/core/src/types/oas3_1.ts
- OAS 3.0: https://github.com/Redocly/redocly-cli/blob/main/packages/core/src/types/oas3.ts
- OAS 2.0: https://github.com/Redocly/redocly-cli/blob/main/packages/core/src/types/oas2.ts
OpenAPI 3.0 and 3.1 node type tree
Root
- openapi (not a node type;
openapi
is a property of theRoot
) Info
Contact
objectLicense
object
- List of
Server
objects (ServerList
)ServerVariables
object
Paths
objectPathItem
objectOperation
object- List of
Parameter
objects (ParameterList
) MediaTypesMap
object is a map of media types and correspondingMediaType
objectsRequestBody
objectResponses
objectResponse
object
XCodeSample
list
- List of
WebhooksMap
objectPathItem
object
Components
objectNamedSchemas
map ofSchema
objectsSchemaProperties
objectDiscriminator
objectDiscriminatorMapping
object
ExternalDocs
object
NamedResponses
map ofResponse
objectsNamedParameters
map ofParameter
objectsNamedExamples
map ofExample
objectsNamedRequestBodies
map ofRequestBody
objectsNamedHeaders
map ofHeader
objectsNamedPathItems
map ofPathItem
objectsNamedSecuritySchemes
map ofSecurityScheme
objectsOAuth2Flows
objectImplicitFlow
objectPasswordFlow
objectAuthenticationCode
objectClientCredentials
object
NamedLinks
map ofLink
objectsNamedCallbacks
map ofCallback
objects
SecurityRequirement
object- List of
Tag
objects (TagList
) ExternalDocs
object
- openapi (not a node type;
Diagrams
The following diagrams are of the most common types and relations.
Root
object
Paths
object
Operation
object
RequestBody
object
Responses
object
Full diagram
Type discovery
Another method of finding types for any given part of an OpenAPI definition is to use the Redocly VS Code extension.
- Install the Redocly VS Code extension.
- Open the OpenAPI definition.
- Place the cursor on the part of the definition you want to find the type for.
- Open the "cursor context" and see the type.