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
Root- openapi (not a node type;
openapiis a property of theRoot) InfoContactobjectLicenseobject
- List of
Serverobjects (ServerList)ServerVariablesobject
PathsobjectPathItemobjectOperationobject- List of
Parameterobjects (ParameterList) MediaTypesMapobject is a map of media types and correspondingMediaTypeobjectsRequestBodyobjectResponsesobjectResponseobject
XCodeSamplelist
- List of
WebhooksMapobjectPathItemobject
ComponentsobjectNamedSchemasmap ofSchemaobjectsSchemaPropertiesobjectDiscriminatorobjectDiscriminatorMappingobject
ExternalDocsobject
NamedResponsesmap ofResponseobjectsNamedParametersmap ofParameterobjectsNamedExamplesmap ofExampleobjectsNamedRequestBodiesmap ofRequestBodyobjectsNamedHeadersmap ofHeaderobjectsNamedPathItemsmap ofPathItemobjectsNamedSecuritySchemesmap ofSecuritySchemeobjectsOAuth2FlowsobjectImplicitFlowobjectPasswordFlowobjectAuthenticationCodeobjectClientCredentialsobject
NamedLinksmap ofLinkobjectsNamedCallbacksmap ofCallbackobjects
SecurityRequirementobject- List of
Tagobjects (TagList) ExternalDocsobject
- openapi (not a node type;
The following diagrams are of the most common types and relations.
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.