From 6040e7a94d3896ff063640b3e8b36d95a189fb7c Mon Sep 17 00:00:00 2001 From: Andrew Tatomyr Date: Tue, 14 Jan 2025 16:55:22 +0200 Subject: [PATCH] fix: add the missing path-only option to sideNavStyle (#1844) * fix: add the missing path-only option to sideNavStyle * update snapshots * add changeset --- .changeset/brave-hotels-deny.md | 6 ++++++ .changeset/light-walls-sleep.md | 5 +++++ .../config-structure/.redocly.yaml | 2 +- .../lint-config/config-structure/snapshot.js | 20 +++++++++---------- package-lock.json | 17 ++++++++-------- packages/core/package.json | 2 +- packages/core/src/__tests__/lint.test.ts | 20 +++++++++---------- packages/core/src/types/redocly-yaml.ts | 2 +- 8 files changed, 43 insertions(+), 31 deletions(-) create mode 100644 .changeset/brave-hotels-deny.md create mode 100644 .changeset/light-walls-sleep.md diff --git a/.changeset/brave-hotels-deny.md b/.changeset/brave-hotels-deny.md new file mode 100644 index 0000000000..cedf558c15 --- /dev/null +++ b/.changeset/brave-hotels-deny.md @@ -0,0 +1,6 @@ +--- +"@redocly/openapi-core": patch +"@redocly/cli": patch +--- + +Updated the `sideNavStyle` configuration schema to include the `path-only` option. diff --git a/.changeset/light-walls-sleep.md b/.changeset/light-walls-sleep.md new file mode 100644 index 0000000000..2599059211 --- /dev/null +++ b/.changeset/light-walls-sleep.md @@ -0,0 +1,5 @@ +--- +"@redocly/openapi-core": patch +--- + +Updated @redocly/config to v0.20.1. diff --git a/__tests__/lint-config/config-structure/.redocly.yaml b/__tests__/lint-config/config-structure/.redocly.yaml index ffc63cc10a..2e3e206dfd 100644 --- a/__tests__/lint-config/config-structure/.redocly.yaml +++ b/__tests__/lint-config/config-structure/.redocly.yaml @@ -62,7 +62,7 @@ responseHeaders: # name: Must be reported as a missing required prop value: 123 # Must be a string -ssoOnPrem: +ssoDirect: oidc: title: 456 # Must be a string type: OIDC diff --git a/__tests__/lint-config/config-structure/snapshot.js b/__tests__/lint-config/config-structure/snapshot.js index cba1991da2..13c6eae096 100644 --- a/__tests__/lint-config/config-structure/snapshot.js +++ b/__tests__/lint-config/config-structure/snapshot.js @@ -185,7 +185,7 @@ The field \`name\` must be present on this level. 63 | value: 123 # Must be a string | ^^^^^^^^^^ 64 | -65 | ssoOnPrem: +65 | ssoDirect: Error was generated by the configuration spec rule. @@ -213,7 +213,7 @@ Expected type \`string\` but got \`integer\`. 63 | value: 123 # Must be a string | ^^^ 64 | -65 | ssoOnPrem: +65 | ssoDirect: Error was generated by the configuration spec rule. @@ -290,11 +290,11 @@ Expected type \`rootRedoclyConfigSchema.apis_additionalProperties.openapi\` (obj Error was generated by the configuration spec rule. -[21] .redocly.yaml:67:12 at #/ssoOnPrem/oidc/title +[21] .redocly.yaml:67:12 at #/ssoDirect/oidc/title Expected type \`string\` but got \`integer\`. -65 | ssoOnPrem: +65 | ssoDirect: 66 | oidc: 67 | title: 456 # Must be a string | ^^^ @@ -304,7 +304,7 @@ Expected type \`string\` but got \`integer\`. Error was generated by the configuration spec rule. -[22] .redocly.yaml:85:9 at #/ssoOnPrem/oidc/defaultTeams/0 +[22] .redocly.yaml:85:9 at #/ssoDirect/oidc/defaultTeams/0 Expected type \`string\` but got \`integer\`. @@ -318,7 +318,7 @@ Expected type \`string\` but got \`integer\`. Error was generated by the configuration spec rule. -[23] .redocly.yaml:80:5 at #/ssoOnPrem/oidc/configuration +[23] .redocly.yaml:80:5 at #/ssoDirect/oidc/configuration The field \`authorization_endpoint\` must be present on this level. @@ -332,7 +332,7 @@ The field \`authorization_endpoint\` must be present on this level. Error was generated by the configuration spec rule. -[24] .redocly.yaml:81:23 at #/ssoOnPrem/oidc/configuration/token_endpoint +[24] .redocly.yaml:81:23 at #/ssoDirect/oidc/configuration/token_endpoint Expected type \`string\` but got \`integer\`. @@ -346,7 +346,7 @@ Expected type \`string\` but got \`integer\`. Error was generated by the configuration spec rule. -[25] .redocly.yaml:78:19 at #/ssoOnPrem/oidc/authorizationRequestCustomParams/login_hint +[25] .redocly.yaml:78:19 at #/ssoDirect/oidc/authorizationRequestCustomParams/login_hint Expected type \`string\` but got \`integer\`. @@ -360,7 +360,7 @@ Expected type \`string\` but got \`integer\`. Error was generated by the configuration spec rule. -[26] .redocly.yaml:87:3 at #/ssoOnPrem/sso-config-schema-without-configurationUrl +[26] .redocly.yaml:87:3 at #/ssoDirect/sso-config-schema-without-configurationUrl The field \`clientId\` must be present on this level. @@ -374,7 +374,7 @@ The field \`clientId\` must be present on this level. Error was generated by the configuration spec rule. -[27] .redocly.yaml:87:3 at #/ssoOnPrem/sso-config-schema-without-configurationUrl +[27] .redocly.yaml:87:3 at #/ssoDirect/sso-config-schema-without-configurationUrl The field \`configurationUrl\` must be present on this level. diff --git a/package-lock.json b/package-lock.json index 1cb03796cf..54aa629207 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3221,9 +3221,10 @@ "link": true }, "node_modules/@redocly/config": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@redocly/config/-/config-0.17.0.tgz", - "integrity": "sha512-iDTUig19ZhsFCbn3XMhXJTcqMgA8IAMkl5ArR8L3+0ulNQJrLuamT/ZXQ3HGoWrKwZjs9glvYSn+ym071pRTbw==" + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@redocly/config/-/config-0.20.1.tgz", + "integrity": "sha512-TYiTDtuItiv95YMsrRxyCs1HKLrDPtTvpaD3+kDKXBnFDeJuYKZ+eHXpCr6YeN4inxfVBs7DLhHsQcs9srddyQ==", + "license": "MIT" }, "node_modules/@redocly/openapi-core": { "resolved": "packages/core", @@ -12635,7 +12636,7 @@ "license": "MIT", "dependencies": { "@redocly/ajv": "^8.11.2", - "@redocly/config": "^0.17.0", + "@redocly/config": "^0.20.1", "colorette": "^1.2.0", "https-proxy-agent": "^7.0.4", "js-levenshtein": "^1.1.6", @@ -15088,15 +15089,15 @@ } }, "@redocly/config": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@redocly/config/-/config-0.17.0.tgz", - "integrity": "sha512-iDTUig19ZhsFCbn3XMhXJTcqMgA8IAMkl5ArR8L3+0ulNQJrLuamT/ZXQ3HGoWrKwZjs9glvYSn+ym071pRTbw==" + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@redocly/config/-/config-0.20.1.tgz", + "integrity": "sha512-TYiTDtuItiv95YMsrRxyCs1HKLrDPtTvpaD3+kDKXBnFDeJuYKZ+eHXpCr6YeN4inxfVBs7DLhHsQcs9srddyQ==" }, "@redocly/openapi-core": { "version": "file:packages/core", "requires": { "@redocly/ajv": "^8.11.2", - "@redocly/config": "^0.17.0", + "@redocly/config": "^0.20.1", "@types/js-levenshtein": "^1.1.0", "@types/js-yaml": "^4.0.3", "@types/minimatch": "^3.0.5", diff --git a/packages/core/package.json b/packages/core/package.json index eaf603d465..4aa6de4896 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -36,7 +36,7 @@ ], "dependencies": { "@redocly/ajv": "^8.11.2", - "@redocly/config": "^0.17.0", + "@redocly/config": "^0.20.1", "colorette": "^1.2.0", "https-proxy-agent": "^7.0.4", "js-levenshtein": "^1.1.6", diff --git a/packages/core/src/__tests__/lint.test.ts b/packages/core/src/__tests__/lint.test.ts index 58cba03144..91b71437d6 100644 --- a/packages/core/src/__tests__/lint.test.ts +++ b/packages/core/src/__tests__/lint.test.ts @@ -76,7 +76,7 @@ const testPortalConfig = parseYamlToDocument( # name: Must be reported as a missing required prop value: 123 # Must be a string - ssoOnPrem: + ssoDirect: oidc: title: 456 # Must be a string type: OIDC @@ -791,7 +791,7 @@ describe('lint', () => { "from": undefined, "location": [ { - "pointer": "#/ssoOnPrem/oidc/title", + "pointer": "#/ssoDirect/oidc/title", "reportOnKey": false, "source": "", }, @@ -805,7 +805,7 @@ describe('lint', () => { "from": undefined, "location": [ { - "pointer": "#/ssoOnPrem/oidc/defaultTeams/0", + "pointer": "#/ssoDirect/oidc/defaultTeams/0", "reportOnKey": false, "source": "", }, @@ -819,7 +819,7 @@ describe('lint', () => { "from": undefined, "location": [ { - "pointer": "#/ssoOnPrem/oidc/configuration", + "pointer": "#/ssoDirect/oidc/configuration", "reportOnKey": true, "source": "", }, @@ -833,7 +833,7 @@ describe('lint', () => { "from": undefined, "location": [ { - "pointer": "#/ssoOnPrem/oidc/configuration/token_endpoint", + "pointer": "#/ssoDirect/oidc/configuration/token_endpoint", "reportOnKey": false, "source": "", }, @@ -847,7 +847,7 @@ describe('lint', () => { "from": undefined, "location": [ { - "pointer": "#/ssoOnPrem/oidc/authorizationRequestCustomParams/login_hint", + "pointer": "#/ssoDirect/oidc/authorizationRequestCustomParams/login_hint", "reportOnKey": false, "source": "", }, @@ -861,7 +861,7 @@ describe('lint', () => { "from": undefined, "location": [ { - "pointer": "#/ssoOnPrem/sso-config-schema-without-configurationUrl", + "pointer": "#/ssoDirect/sso-config-schema-without-configurationUrl", "reportOnKey": true, "source": "", }, @@ -875,7 +875,7 @@ describe('lint', () => { "from": undefined, "location": [ { - "pointer": "#/ssoOnPrem/sso-config-schema-without-configurationUrl", + "pointer": "#/ssoDirect/sso-config-schema-without-configurationUrl", "reportOnKey": true, "source": "", }, @@ -1205,12 +1205,12 @@ describe('lint', () => { "from": undefined, "location": [ { - "pointer": "#/ssoOnPrem", + "pointer": "#/ssoDirect", "reportOnKey": true, "source": "", }, ], - "message": "Property \`ssoOnPrem\` is not expected here.", + "message": "Property \`ssoDirect\` is not expected here.", "ruleId": "configuration spec", "severity": "error", "suggest": [], diff --git a/packages/core/src/types/redocly-yaml.ts b/packages/core/src/types/redocly-yaml.ts index 5d7994afc5..4735fc55a5 100644 --- a/packages/core/src/types/redocly-yaml.ts +++ b/packages/core/src/types/redocly-yaml.ts @@ -1093,7 +1093,7 @@ const ConfigReferenceDocs: NodeType = { showObjectSchemaExamples: { type: 'boolean' }, disableTryItRequestUrlEncoding: { type: 'boolean' }, sidebarLinks: 'ConfigSidebarLinks', - sideNavStyle: { enum: ['summary-only', 'path-first', 'id-only'] }, + sideNavStyle: { enum: ['summary-only', 'path-first', 'id-only', 'path-only'] }, simpleOneOfTypeLabel: { type: 'boolean' }, sortEnumValuesAlphabetically: { type: 'boolean' }, sortOperationsAlphabetically: { type: 'boolean' },