Skip to content

Commit 570a693

Browse files
authored
docs: make redocly config explicit (#1650)
Per discussion on #1633, it looks like `redocly` config needs to be more explicit. This PR extract the current "minimal" `redocly` config from source (https://github.com/Redocly/redocly-cli/blob/2367722a9fb173e55626dccbdac7b6694dd8b199/packages/core/src/config/minimal.ts#L52-L112) into a config file. This should simplify tracking of future changes to this config. Similarity to existing config can be confirmed with: ```sh $ diff <(npx --no @redocly/cli lint --extends=minimal docs/api.yaml 2>&1) <(npx --no @redocly/cli lint --config docs/redocly.conf.yaml docs/api.yaml 2>&1) 1,2d0 < No configurations were provided -- using built in recommended configuration by default. < 1447c1445 < docs/api.yaml: validated in 451ms --- > docs/api.yaml: validated in 415ms ```
1 parent d7c47e6 commit 570a693

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,4 @@ api-docs:
168168
.PHONY: api-docs-lint
169169
api-docs-lint:
170170
node lib/bin/openapi-docs-lint.js docs/api.yaml && \
171-
npx --no @redocly/cli lint --extends=minimal docs/api.yaml
171+
npx --no @redocly/cli lint --config docs/redocly.conf.yaml docs/api.yaml

docs/redocly.conf.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
rules:
2+
no-ambiguous-paths: warn
3+
no-empty-servers: warn
4+
no-enum-type-mismatch: warn
5+
no-example-value-and-externalValue: warn
6+
no-identical-paths: warn
7+
no-invalid-media-type-examples:
8+
severity: warn
9+
allowAdditionalProperties: false
10+
no-path-trailing-slash: warn
11+
no-required-schema-properties-undefined: warn
12+
no-schema-type-mismatch: warn
13+
no-server-example.com: warn
14+
no-server-trailing-slash: error
15+
no-server-variables-empty-enum: error
16+
no-undefined-server-variable: warn
17+
no-unresolved-refs: error
18+
no-unused-components: warn
19+
nullable-type-sibling: warn
20+
operation-2xx-response: warn
21+
operation-operationId: warn
22+
operation-operationId-unique: warn
23+
operation-operationId-url-safe: warn
24+
operation-parameters-unique: warn
25+
operation-summary: warn
26+
path-declaration-must-exist: warn
27+
path-not-include-query: warn
28+
path-parameters-defined: warn
29+
security-defined: warn
30+
spec-components-invalid-map-name: warn
31+
struct: error
32+
tag-description: warn

0 commit comments

Comments
 (0)