Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/funny-lobsters-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@redocly/openapi-core": minor
"@redocly/cli": minor
---

Added support for linting, preprocessors, decorators, and type extensions for Overlay v1 documents.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/cli/src/__tests__/commands/lint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('handleLint', () => {
getMergedConfigMock.mockReset();
});

describe('loadConfig and getEnrtypoints stage', () => {
describe('loadConfig and getEntrypoints stage', () => {
it('should fail if config file does not exist', async () => {
await commandWrapper(handleLint)({ ...argvMock, config: 'config.yaml' });
expect(exitWithError).toHaveBeenCalledWith(
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export function commandWrapper<T extends CommandOptions>(
? 'asyncapi'
: document?.arazzo
? 'arazzo'
: document?.overlay
? 'overlay'
: undefined;
if (specKeyword) {
specFullVersion = document[specKeyword] as string;
Expand Down
5 changes: 5 additions & 0 deletions packages/core/src/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,11 @@ export function mapTypeToComponent(typeName: string, version: SpecMajorVersion)
default:
return null;
}
case SpecMajorVersion.Overlay1:
switch (typeName) {
default:
return null;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ exports[`resolveConfig should ignore minimal from the root and read local file 1
"tag-description": "warn",
"tags-alphabetical": "off",
},
"overlay1Decorators": {},
"overlay1Preprocessors": {},
"overlay1Rules": {
"info-contact": "off",
},
"preprocessors": {},
"recommendedFallback": false,
"rules": {
Expand Down Expand Up @@ -443,6 +448,11 @@ exports[`resolveStyleguideConfig should resolve extends with local file config w
"tag-description": "warn",
"tags-alphabetical": "off",
},
"overlay1Decorators": {},
"overlay1Preprocessors": {},
"overlay1Rules": {
"info-contact": "off",
},
"preprocessors": {},
"recommendedFallback": undefined,
"rules": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ StyleguideConfig {
"oas3_0": {},
"oas3_1": {},
},
"overlay1": {
"oas2": {},
"oas3_0": {},
"oas3_1": {},
},
},
"doNotResolveExamples": false,
"extendPaths": [],
Expand Down Expand Up @@ -76,6 +81,11 @@ StyleguideConfig {
"oas3_0": {},
"oas3_1": {},
},
"overlay1": {
"oas2": {},
"oas3_0": {},
"oas3_1": {},
},
},
"rawConfig": {
"_usedRules": Set {},
Expand Down Expand Up @@ -203,6 +213,20 @@ StyleguideConfig {
"operation-summary": "error",
},
},
"overlay1": {
"oas2": {
"no-empty-servers": "error",
"operation-summary": "error",
},
"oas3_0": {
"no-empty-servers": "error",
"operation-summary": "error",
},
"oas3_1": {
"no-empty-servers": "error",
"operation-summary": "error",
},
},
},
}
`;
11 changes: 11 additions & 0 deletions packages/core/src/config/__tests__/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ describe('getMergedConfig', () => {
"oas2": {},
"oas3_0": {},
"oas3_1": {},
"overlay1": {},
},
"doNotResolveExamples": false,
"extendPaths": [],
Expand All @@ -136,6 +137,7 @@ describe('getMergedConfig', () => {
"oas2": {},
"oas3_0": {},
"oas3_1": {},
"overlay1": {},
},
"rawConfig": {
"extendPaths": [],
Expand Down Expand Up @@ -164,6 +166,9 @@ describe('getMergedConfig', () => {
"oas3_1": {
"operation-summary": "warn",
},
"overlay1": {
"operation-summary": "warn",
},
},
},
"telemetry": "on",
Expand Down Expand Up @@ -238,6 +243,7 @@ describe('getMergedConfig', () => {
"oas2": {},
"oas3_0": {},
"oas3_1": {},
"overlay1": {},
},
"doNotResolveExamples": false,
"extendPaths": [],
Expand All @@ -251,6 +257,7 @@ describe('getMergedConfig', () => {
"oas2": {},
"oas3_0": {},
"oas3_1": {},
"overlay1": {},
},
"rawConfig": {
"extendPaths": [],
Expand Down Expand Up @@ -287,6 +294,10 @@ describe('getMergedConfig', () => {
"no-empty-servers": "error",
"operation-summary": "error",
},
"overlay1": {
"no-empty-servers": "error",
"operation-summary": "error",
},
},
},
"telemetry": "on",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/config/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ const all: PluginStyleguideConfig<'built-in'> = {
'workflowId-unique': 'error',
'workflow-dependsOn': 'error',
},
overlay1Rules: {
'info-contact': 'error',
},
};

export default all;
Loading
Loading