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
object -
License
object -
List of
Server
objects (ServerList
) -
ServerVariables
object -
Paths
object -
PathItem
object -
Operation
object-
List of
Parameter
objects (ParameterList
) -
MediaTypesMap
object is a map of media types and correspondingMediaType
objects-
RequestBody
object -
Responses
object-
Response
object
-
-
-
XCodeSample
list
-
List of
-
WebhooksMap
object -
PathItem
object -
Components
object -
NamedSchemas
map ofSchema
objects-
SchemaProperties
object -
Discriminator
object -
DiscriminatorMapping
object -
ExternalDocs
object
-
-
NamedResponses
map ofResponse
objects -
NamedParameters
map ofParameter
objects -
NamedExamples
map ofExample
objects -
NamedRequestBodies
map ofRequestBody
objects -
NamedHeaders
map ofHeader
objects -
NamedPathItems
map ofPathItem
objects -
NamedSecuritySchemes
map ofSecurityScheme
objects-
OAuth2Flows
object-
ImplicitFlow
object -
PasswordFlow
object -
AuthenticationCode
object -
ClientCredentials
object
-
-
-
NamedLinks
map ofLink
objects -
NamedCallbacks
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.