Skip to content

Commit

Permalink
fix: add the missing path-only option to sideNavStyle (#1844)
Browse files Browse the repository at this point in the history
* fix: add the missing path-only option to sideNavStyle

* update snapshots

* add changeset
  • Loading branch information
tatomyr authored Jan 14, 2025
1 parent a83c292 commit 6040e7a
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 31 deletions.
6 changes: 6 additions & 0 deletions .changeset/brave-hotels-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@redocly/openapi-core": patch
"@redocly/cli": patch
---

Updated the `sideNavStyle` configuration schema to include the `path-only` option.
5 changes: 5 additions & 0 deletions .changeset/light-walls-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@redocly/openapi-core": patch
---

Updated @redocly/config to v0.20.1.
2 changes: 1 addition & 1 deletion __tests__/lint-config/config-structure/.redocly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions __tests__/lint-config/config-structure/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
| ^^^
Expand All @@ -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\`.
Expand All @@ -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.
Expand All @@ -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\`.
Expand All @@ -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\`.
Expand All @@ -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.
Expand All @@ -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.
Expand Down
17 changes: 9 additions & 8 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
20 changes: 10 additions & 10 deletions packages/core/src/__tests__/lint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -791,7 +791,7 @@ describe('lint', () => {
"from": undefined,
"location": [
{
"pointer": "#/ssoOnPrem/oidc/title",
"pointer": "#/ssoDirect/oidc/title",
"reportOnKey": false,
"source": "",
},
Expand All @@ -805,7 +805,7 @@ describe('lint', () => {
"from": undefined,
"location": [
{
"pointer": "#/ssoOnPrem/oidc/defaultTeams/0",
"pointer": "#/ssoDirect/oidc/defaultTeams/0",
"reportOnKey": false,
"source": "",
},
Expand All @@ -819,7 +819,7 @@ describe('lint', () => {
"from": undefined,
"location": [
{
"pointer": "#/ssoOnPrem/oidc/configuration",
"pointer": "#/ssoDirect/oidc/configuration",
"reportOnKey": true,
"source": "",
},
Expand All @@ -833,7 +833,7 @@ describe('lint', () => {
"from": undefined,
"location": [
{
"pointer": "#/ssoOnPrem/oidc/configuration/token_endpoint",
"pointer": "#/ssoDirect/oidc/configuration/token_endpoint",
"reportOnKey": false,
"source": "",
},
Expand All @@ -847,7 +847,7 @@ describe('lint', () => {
"from": undefined,
"location": [
{
"pointer": "#/ssoOnPrem/oidc/authorizationRequestCustomParams/login_hint",
"pointer": "#/ssoDirect/oidc/authorizationRequestCustomParams/login_hint",
"reportOnKey": false,
"source": "",
},
Expand All @@ -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": "",
},
Expand All @@ -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": "",
},
Expand Down Expand Up @@ -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": [],
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/types/redocly-yaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down

1 comment on commit 6040e7a

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 78.63% 5047/6419
🟡 Branches 67.28% 2056/3056
🟡 Functions 73.13% 833/1139
🟡 Lines 78.92% 4761/6033

Test suite run success

833 tests passing in 120 suites.

Report generated by 🧪jest coverage report action from 6040e7a

Please sign in to comment.