mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-07 20:57:49 +00:00
* docs: Add resolve config reference * docs: Start API reference, needs child config entries * docs: Add sidebar entries for config reference pages * docs: Add rules and decorators config pages * docs: Fix links and format * docs: Fix links and formatting * docs: Add extends and plugins config reference pages * docs: Add a basic preprocessor page * docs: Update from review feedback * Apply suggestions from code review Co-authored-by: Heather Cloward <heathercloward@gmail.com> * docs: Reformat required labels * Apply suggestions from code review Co-authored-by: Heather Cloward <heathercloward@gmail.com> * docs: Fix misspelling --------- Co-authored-by: Heather Cloward <heathercloward@gmail.com>
1.7 KiB
1.7 KiB
apis
Introduction
If your project contains multiple APIs, the apis configuration section allows you to set up different rules and settings for different APIs.
Options
{% table %}
- Option
- Type
- Description
{name}@{version}- API object
- REQUIRED. Each API needs a name and optionally a version. Supports alphanumeric characters and underscores.
{% /table %}
API object
{% table %}
- Option
- Type
- Description
- root
- string
- REQUIRED. Path to the root API description file.
- rules
- Rules object
- Additional rule configuration for this API.
- decorators
- Decorators object
- Additional decorator configuration for this API.
- preprocessors
- Decorators object
- Preprocessors run before linting, and follow the same structure as decorators. We recommend the use of decorators over preprocessors in most cases.
{% /table %}
Examples
The following example shows a simple redocly.yaml configuration file with settings for multiple APIs.
apis:
orders@v3:
root: orders/openapi.yaml
rules:
tags-alphabetical: error
operation-operationId-unique: error
spec-strict-refs: error
newsletter:
root: newsletter/openapi.yaml
rules:
info-contact: off
operation-summary: off
Related options
- extends sets the base ruleset to use.
- rules settings define the linting rules that are used.
- decorators offer some transformations for your OpenAPI documents.
Resources
- More information and examples of per-API configuration.
- List of built-in rules.