diff --git a/.changeset/orange-shirts-sneeze.md b/.changeset/orange-shirts-sneeze.md new file mode 100644 index 00000000..5ae0d3d0 --- /dev/null +++ b/.changeset/orange-shirts-sneeze.md @@ -0,0 +1,5 @@ +--- +"@redocly/openapi-core": patch +--- + +Updated @redocly/config to v0.10.0. diff --git a/__tests__/build-docs/build-docs-with-config-option/nested/redocly.yaml b/__tests__/build-docs/build-docs-with-config-option/nested/redocly.yaml index 1ec74bae..52488a1b 100644 --- a/__tests__/build-docs/build-docs-with-config-option/nested/redocly.yaml +++ b/__tests__/build-docs/build-docs-with-config-option/nested/redocly.yaml @@ -1,5 +1,4 @@ extends: - minimal -theme: - openapi: - htmlTemplate: ../index.hbs +openapi: + htmlTemplate: ../index.hbs diff --git a/__tests__/commands.test.ts b/__tests__/commands.test.ts index 1f6e793f..b34bd618 100644 --- a/__tests__/commands.test.ts +++ b/__tests__/commands.test.ts @@ -603,7 +603,7 @@ describe('E2E', () => { (expect(cleanupOutput(result))).toMatchSpecificSnapshot(join(testPath, 'snapshot.js')); expect(fs.existsSync(join(testPath, 'nested/redoc-static.html'))).toEqual(true); - expect(fs.statSync(join(testPath, 'nested/redoc-static.html')).size).toEqual(33012); + expect(fs.statSync(join(testPath, 'nested/redoc-static.html')).size).toEqual(32949); }); }); diff --git a/__tests__/lint-config/config-structure/.redocly.yaml b/__tests__/lint-config/config-structure/.redocly.yaml index 8ef8d9a4..3fe6df02 100644 --- a/__tests__/lint-config/config-structure/.redocly.yaml +++ b/__tests__/lint-config/config-structure/.redocly.yaml @@ -8,9 +8,8 @@ apis: root: 456 # Must be a string with-theme: root: ./openapi.yaml - theme: - openapi: wrong, must be an object - not-expected: Must fail + openapi: wrong, must be an object + not-expected: Must fail seo: keywords: 789 # Must be an array @@ -142,111 +141,110 @@ env: referenced-env: $ref: ./env.yaml -theme: - breadcrumbs: - hide: false - prefixItems: - - label: Home - page: '/' - imports: - - '@redocly/test-theme' +breadcrumbs: + hide: false + prefixItems: + - label: Home + page: '/' +imports: + - '@redocly/test-theme' - logo: - srcSet: './images/redocly-black-logo.svg light, ./images/redocly-brand-logo.svg dark' - altText: Test - link: / - asyncapi: - hideInfo: false - expandSchemas: - root: true - elements: true - navbar: - items: - - label: Markdown - page: /markdown/ +logo: + srcSet: './images/redocly-black-logo.svg light, ./images/redocly-brand-logo.svg dark' + altText: Test + link: / +asyncapi: + hideInfo: false + expandSchemas: + root: true + elements: true +navbar: + items: + - label: Markdown + page: /markdown/ - search: - shortcuts: - - ctrl+f - - cmd+k - - / - suggestedPages: - - label: TSX page - page: tsx.page.tsx - - page: /my-catalog/ +search: + shortcuts: + - ctrl+f + - cmd+k + - / + suggestedPages: + - label: TSX page + page: tsx.page.tsx + - page: /my-catalog/ - footer: - copyrightText: Copyright © Test 2019-2020. - items: - - group: Legal - items: - - label: Terms of Use - href: 'https://test.com/' # Not expected - - markdown: - lastUpdatedBlock: - format: 'long' - editPage: - baseUrl: https://test.com - graphql: - pagination: section - menu: - requireExactGroups: false - groups: - - name: 'GraphQL custom group' - directives: - includeByName: - - cacheControl - - typeDirective - otherItemsGroupName: 'Other' - sidebar: - separatorLine: true - linePosition: top - catalog: - main: - title: API Catalog - description: 'This is a description of the API Catalog' - slug: /my-catalog/ - filters: - - title: Domain - property: domain - missingCategoryName: Other - - title: API Category - property: category - missingCategoryName: Other - groupByFirstFilter: false +footer: + copyrightText: Copyright © Test 2019-2020. + items: + - group: Legal items: - - directory: ./ - flatten: true - includeByMetadata: - type: [openapi] - scorecard: - ignoreNonCompliant: true - levels: - - name: Baseline - extends: - - minimal - - name: Silver - extends: - - recommended - rules: - info-description: off + - label: Terms of Use + href: 'https://test.com/' # Not expected - - name: Gold - rules: - rule/path-item-get-required: - severity: warn - subject: - type: PathItem - message: Every path item must have a GET operation. - assertions: - required: - - get +markdown: + lastUpdatedBlock: + format: 'long' + editPage: + baseUrl: https://test.com +graphql: + pagination: section + menu: + requireExactGroups: false + groups: + - name: 'GraphQL custom group' + directives: + includeByName: + - cacheControl + - typeDirective + otherItemsGroupName: 'Other' +sidebar: + separatorLine: true + linePosition: top +catalog: + main: + title: API Catalog + description: 'This is a description of the API Catalog' + slug: /my-catalog/ + filters: + - title: Domain + property: domain + missingCategoryName: Other + - title: API Category + property: category + missingCategoryName: Other + groupByFirstFilter: false + items: + - directory: ./ + flatten: true + includeByMetadata: + type: [openapi] +scorecard: + ignoreNonCompliant: true + levels: + - name: Baseline + extends: + - minimal + - name: Silver + extends: + - recommended + rules: + info-description: off - operation-4xx-response: warn - targets: - - where: - metadata: - l0: Distribution - publishDateRange: 2021-01-01T00:00:00Z/2022-01-01 - minimumLevel: Silver + - name: Gold + rules: + rule/path-item-get-required: + severity: warn + subject: + type: PathItem + message: Every path item must have a GET operation. + assertions: + required: + - get + + operation-4xx-response: warn + targets: + - where: + metadata: + l0: Distribution + publishDateRange: 2021-01-01T00:00:00Z/2022-01-01 + minimumLevel: Silver diff --git a/__tests__/lint-config/config-structure/snapshot.js b/__tests__/lint-config/config-structure/snapshot.js index 02cb896d..cba1991d 100644 --- a/__tests__/lint-config/config-structure/snapshot.js +++ b/__tests__/lint-config/config-structure/snapshot.js @@ -14,35 +14,49 @@ Expected type \`string\` but got \`integer\`. Error was generated by the configuration spec rule. -[2] .redocly.yaml:95:5 at #/sso/0 +[2] .redocly.yaml:94:5 at #/sso/0 \`sso\` can be one of the following only: "REDOCLY", "CORPORATE", "GUEST". -93 | -94 | sso: -95 | - WRONG # Does not match allowed options +92 | +93 | sso: +94 | - WRONG # Does not match allowed options | ^^^^^ -96 | -97 | developerOnboarding: +95 | +96 | developerOnboarding: Error was generated by the configuration spec rule. -[3] .redocly.yaml:128:1 at #/not-listed-filed +[3] .redocly.yaml:127:1 at #/not-listed-filed Property \`not-listed-filed\` is not expected here. -126 | test: anything -127 | -128 | not-listed-filed: Must be reported as not expected +125 | test: anything +126 | +127 | not-listed-filed: Must be reported as not expected | ^^^^^^^^^^^^^^^^ -129 | -130 | env: +128 | +129 | env: Error was generated by the configuration spec rule. -[4] .redocly.yaml:20:5 at #/redirects/some-redirect/t1o +[4] .redocly.yaml:156:1 at #/asyncapi + +Property \`asyncapi\` is not expected here. + +154 | altText: Test +155 | link: / +156 | asyncapi: + | ^^^^^^^^ +157 | hideInfo: false +158 | expandSchemas: + +Error was generated by the configuration spec rule. + + +[5] .redocly.yaml:19:5 at #/redirects/some-redirect/t1o Property \`t1o\` is not expected here. @@ -50,161 +64,161 @@ Did you mean: - to - type -18 | redirects: -19 | some-redirect: -20 | t1o: Wrong name, should be 'two' +17 | redirects: +18 | some-redirect: +19 | t1o: Wrong name, should be 'two' | ^^^ -21 | type: wrong type, must be a number -22 | +20 | type: wrong type, must be a number +21 | Error was generated by the configuration spec rule. -[5] .redocly.yaml:21:11 at #/redirects/some-redirect/type +[6] .redocly.yaml:20:11 at #/redirects/some-redirect/type Expected type \`number\` but got \`string\`. -19 | some-redirect: -20 | t1o: Wrong name, should be 'two' -21 | type: wrong type, must be a number +18 | some-redirect: +19 | t1o: Wrong name, should be 'two' +20 | type: wrong type, must be a number | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -22 | -23 | rbac: +21 | +22 | rbac: Error was generated by the configuration spec rule. -[6] .redocly.yaml:16:13 at #/seo/keywords +[7] .redocly.yaml:15:13 at #/seo/keywords Expected type \`array\` but got \`integer\`. -14 | -15 | seo: -16 | keywords: 789 # Must be an array +13 | +14 | seo: +15 | keywords: 789 # Must be an array | ^^^ -17 | -18 | redirects: +16 | +17 | redirects: Error was generated by the configuration spec rule. -[7] .redocly.yaml:54:23 at #/rbac/content/**/additionalProp +[8] .redocly.yaml:53:23 at #/rbac/content/**/additionalProp Expected type \`string\` but got \`integer\`. -52 | content: -53 | '**': -54 | additionalProp: 456 # Must be a stirng +51 | content: +52 | '**': +53 | additionalProp: 456 # Must be a stirng | ^^^ -55 | foo: -56 | additionalProp2: 789 # Must be a stirng +54 | foo: +55 | additionalProp2: 789 # Must be a stirng Error was generated by the configuration spec rule. -[8] .redocly.yaml:56:24 at #/rbac/content/foo/additionalProp2 +[9] .redocly.yaml:55:24 at #/rbac/content/foo/additionalProp2 Expected type \`string\` but got \`integer\`. -54 | additionalProp: 456 # Must be a stirng -55 | foo: -56 | additionalProp2: 789 # Must be a stirng +53 | additionalProp: 456 # Must be a stirng +54 | foo: +55 | additionalProp2: 789 # Must be a stirng | ^^^ -57 | -58 | responseHeaders: +56 | +57 | responseHeaders: Error was generated by the configuration spec rule. -[9] .redocly.yaml:51:16 at #/rbac/additional-property/something +[10] .redocly.yaml:50:16 at #/rbac/additional-property/something Expected type \`string\` but got \`integer\`. -49 | anonymous: read -50 | additional-property: -51 | something: 123 # Must be a string +48 | anonymous: read +49 | additional-property: +50 | something: 123 # Must be a string | ^^^ -52 | content: -53 | '**': +51 | content: +52 | '**': Error was generated by the configuration spec rule. -[10] .redocly.yaml:59:16 at #/responseHeaders/some-header +[11] .redocly.yaml:58:16 at #/responseHeaders/some-header Expected type \`rootRedoclyConfigSchema.responseHeaders_additionalProperties\` (array) but got \`string\` -57 | -58 | responseHeaders: -59 | some-header: wrong, must be an array +56 | +57 | responseHeaders: +58 | some-header: wrong, must be an array | ^^^^^^^^^^^^^^^^^^^^^^^ -60 | some-header2: -61 | - wrong, must be an object +59 | some-header2: +60 | - wrong, must be an object Error was generated by the configuration spec rule. -[11] .redocly.yaml:61:7 at #/responseHeaders/some-header2/0 +[12] .redocly.yaml:60:7 at #/responseHeaders/some-header2/0 Expected type \`rootRedoclyConfigSchema.responseHeaders_additionalProperties_items\` (object) but got \`string\` -59 | some-header: wrong, must be an array -60 | some-header2: -61 | - wrong, must be an object +58 | some-header: wrong, must be an array +59 | some-header2: +60 | - wrong, must be an object | ^^^^^^^^^^^^^^^^^^^^^^^^ -62 | - unexpected-property: Should fail -63 | # name: Must be reported as a missing required prop +61 | - unexpected-property: Should fail +62 | # name: Must be reported as a missing required prop Error was generated by the configuration spec rule. -[12] .redocly.yaml:62:7 at #/responseHeaders/some-header2/1 +[13] .redocly.yaml:61:7 at #/responseHeaders/some-header2/1 The field \`name\` must be present on this level. -60 | some-header2: -61 | - wrong, must be an object -62 | - unexpected-property: Should fail +59 | some-header2: +60 | - wrong, must be an object +61 | - unexpected-property: Should fail | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -63 | # name: Must be reported as a missing required prop +62 | # name: Must be reported as a missing required prop | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -64 | value: 123 # Must be a string +63 | value: 123 # Must be a string | ^^^^^^^^^^ -65 | -66 | ssoOnPrem: +64 | +65 | ssoOnPrem: Error was generated by the configuration spec rule. -[13] .redocly.yaml:62:7 at #/responseHeaders/some-header2/1/unexpected-property +[14] .redocly.yaml:61:7 at #/responseHeaders/some-header2/1/unexpected-property Property \`unexpected-property\` is not expected here. -60 | some-header2: -61 | - wrong, must be an object -62 | - unexpected-property: Should fail +59 | some-header2: +60 | - wrong, must be an object +61 | - unexpected-property: Should fail | ^^^^^^^^^^^^^^^^^^^ -63 | # name: Must be reported as a missing required prop -64 | value: 123 # Must be a string +62 | # name: Must be reported as a missing required prop +63 | value: 123 # Must be a string Error was generated by the configuration spec rule. -[14] .redocly.yaml:64:14 at #/responseHeaders/some-header2/1/value +[15] .redocly.yaml:63:14 at #/responseHeaders/some-header2/1/value Expected type \`string\` but got \`integer\`. -62 | - unexpected-property: Should fail -63 | # name: Must be reported as a missing required prop -64 | value: 123 # Must be a string +61 | - unexpected-property: Should fail +62 | # name: Must be reported as a missing required prop +63 | value: 123 # Must be a string | ^^^ -65 | -66 | ssoOnPrem: +64 | +65 | ssoOnPrem: Error was generated by the configuration spec rule. -[15] .redocly.yaml:4:3 at #/apis/without-root +[16] .redocly.yaml:4:3 at #/apis/without-root The field \`root\` must be present on this level. @@ -218,7 +232,7 @@ The field \`root\` must be present on this level. Error was generated by the configuration spec rule. -[16] .redocly.yaml:5:5 at #/apis/without-root/foo +[17] .redocly.yaml:5:5 at #/apis/without-root/foo Property \`foo\` is not expected here. @@ -234,7 +248,7 @@ Did you mean: root ? Error was generated by the configuration spec rule. -[17] .redocly.yaml:8:11 at #/apis/with-wrong-root/root +[18] .redocly.yaml:8:11 at #/apis/with-wrong-root/root Expected type \`string\` but got \`integer\`. @@ -248,362 +262,362 @@ Expected type \`string\` but got \`integer\`. Error was generated by the configuration spec rule. -[18] .redocly.yaml:13:7 at #/apis/with-theme/theme/not-expected +[19] .redocly.yaml:12:5 at #/apis/with-theme/not-expected Property \`not-expected\` is not expected here. -11 | theme: -12 | openapi: wrong, must be an object -13 | not-expected: Must fail - | ^^^^^^^^^^^^ -14 | -15 | seo: +10 | root: ./openapi.yaml +11 | openapi: wrong, must be an object +12 | not-expected: Must fail + | ^^^^^^^^^^^^ +13 | +14 | seo: Error was generated by the configuration spec rule. -[19] .redocly.yaml:12:16 at #/apis/with-theme/theme/openapi +[20] .redocly.yaml:11:14 at #/apis/with-theme/openapi -Expected type \`rootRedoclyConfigSchema.apis_additionalProperties.theme.openapi\` (object) but got \`string\` +Expected type \`rootRedoclyConfigSchema.apis_additionalProperties.openapi\` (object) but got \`string\` -10 | root: ./openapi.yaml -11 | theme: -12 | openapi: wrong, must be an object + 9 | with-theme: +10 | root: ./openapi.yaml +11 | openapi: wrong, must be an object | ^^^^^^^^^^^^^^^^^^^^^^^^ -13 | not-expected: Must fail -14 | +12 | not-expected: Must fail +13 | Error was generated by the configuration spec rule. -[20] .redocly.yaml:68:12 at #/ssoOnPrem/oidc/title +[21] .redocly.yaml:67:12 at #/ssoOnPrem/oidc/title Expected type \`string\` but got \`integer\`. -66 | ssoOnPrem: -67 | oidc: -68 | title: 456 # Must be a string +65 | ssoOnPrem: +66 | oidc: +67 | title: 456 # Must be a string | ^^^ -69 | type: OIDC -70 | configurationUrl: http://localhost/oidc/.well-known/openid-configuration +68 | type: OIDC +69 | configurationUrl: http://localhost/oidc/.well-known/openid-configuration Error was generated by the configuration spec rule. -[21] .redocly.yaml:86:9 at #/ssoOnPrem/oidc/defaultTeams/0 +[22] .redocly.yaml:85:9 at #/ssoOnPrem/oidc/defaultTeams/0 Expected type \`string\` but got \`integer\`. -84 | additional-propery: Must be allowed -85 | defaultTeams: -86 | - 456 # Must be a string +83 | additional-propery: Must be allowed +84 | defaultTeams: +85 | - 456 # Must be a string | ^^^ -87 | -88 | sso-config-schema-without-configurationUrl: +86 | +87 | sso-config-schema-without-configurationUrl: Error was generated by the configuration spec rule. -[22] .redocly.yaml:81:5 at #/ssoOnPrem/oidc/configuration +[23] .redocly.yaml:80:5 at #/ssoOnPrem/oidc/configuration The field \`authorization_endpoint\` must be present on this level. -79 | login_hint: 789 # Must be a string -80 | prompt: login -81 | configuration: +78 | login_hint: 789 # Must be a string +79 | prompt: login +80 | configuration: | ^^^^^^^^^^^^^ -82 | token_endpoint: 123 # Must be a string -83 | # authorization_endpoint: Must be reported as a missing required prop +81 | token_endpoint: 123 # Must be a string +82 | # authorization_endpoint: Must be reported as a missing required prop Error was generated by the configuration spec rule. -[23] .redocly.yaml:82:23 at #/ssoOnPrem/oidc/configuration/token_endpoint +[24] .redocly.yaml:81:23 at #/ssoOnPrem/oidc/configuration/token_endpoint Expected type \`string\` but got \`integer\`. -80 | prompt: login -81 | configuration: -82 | token_endpoint: 123 # Must be a string +79 | prompt: login +80 | configuration: +81 | token_endpoint: 123 # Must be a string | ^^^ -83 | # authorization_endpoint: Must be reported as a missing required prop -84 | additional-propery: Must be allowed +82 | # authorization_endpoint: Must be reported as a missing required prop +83 | additional-propery: Must be allowed Error was generated by the configuration spec rule. -[24] .redocly.yaml:79:19 at #/ssoOnPrem/oidc/authorizationRequestCustomParams/login_hint +[25] .redocly.yaml:78:19 at #/ssoOnPrem/oidc/authorizationRequestCustomParams/login_hint Expected type \`string\` but got \`integer\`. -77 | - default -78 | authorizationRequestCustomParams: -79 | login_hint: 789 # Must be a string +76 | - default +77 | authorizationRequestCustomParams: +78 | login_hint: 789 # Must be a string | ^^^ -80 | prompt: login -81 | configuration: +79 | prompt: login +80 | configuration: Error was generated by the configuration spec rule. -[25] .redocly.yaml:88:3 at #/ssoOnPrem/sso-config-schema-without-configurationUrl +[26] .redocly.yaml:87:3 at #/ssoOnPrem/sso-config-schema-without-configurationUrl The field \`clientId\` must be present on this level. -86 | - 456 # Must be a string -87 | -88 | sso-config-schema-without-configurationUrl: +85 | - 456 # Must be a string +86 | +87 | sso-config-schema-without-configurationUrl: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -89 | type: OIDC -90 | # clientId: Must be reported as a missing required prop +88 | type: OIDC +89 | # clientId: Must be reported as a missing required prop Error was generated by the configuration spec rule. -[26] .redocly.yaml:88:3 at #/ssoOnPrem/sso-config-schema-without-configurationUrl +[27] .redocly.yaml:87:3 at #/ssoOnPrem/sso-config-schema-without-configurationUrl The field \`configurationUrl\` must be present on this level. -86 | - 456 # Must be a string -87 | -88 | sso-config-schema-without-configurationUrl: +85 | - 456 # Must be a string +86 | +87 | sso-config-schema-without-configurationUrl: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -89 | type: OIDC -90 | # clientId: Must be reported as a missing required prop +88 | type: OIDC +89 | # clientId: Must be reported as a missing required prop Error was generated by the configuration spec rule. -[27] .redocly.yaml:98:3 at #/developerOnboarding/wrong +[28] .redocly.yaml:97:3 at #/developerOnboarding/wrong Property \`wrong\` is not expected here. - 96 | - 97 | developerOnboarding: - 98 | wrong: A not allowed field - | ^^^^^ - 99 | adapters: -100 | - should be object +95 | +96 | developerOnboarding: +97 | wrong: A not allowed field + | ^^^^^ +98 | adapters: +99 | - should be object Error was generated by the configuration spec rule. -[28] .redocly.yaml:100:7 at #/developerOnboarding/adapters/0 +[29] .redocly.yaml:99:7 at #/developerOnboarding/adapters/0 Expected type \`APIGEE_X\` (object) but got \`string\` - 98 | wrong: A not allowed field - 99 | adapters: -100 | - should be object + 97 | wrong: A not allowed field + 98 | adapters: + 99 | - should be object | ^^^^^^^^^^^^^^^^ -101 | - type: 123 # Must be a string -102 | - type: APIGEE_X +100 | - type: 123 # Must be a string +101 | - type: APIGEE_X Error was generated by the configuration spec rule. -[29] .redocly.yaml:101:7 at #/developerOnboarding/adapters/1 +[30] .redocly.yaml:100:7 at #/developerOnboarding/adapters/1 The field \`organizationName\` must be present on this level. - 99 | adapters: -100 | - should be object -101 | - type: 123 # Must be a string + 98 | adapters: + 99 | - should be object +100 | - type: 123 # Must be a string | ^^^^^^^^^ -102 | - type: APIGEE_X -103 | # organizationName: Must be reported as a missing required prop +101 | - type: APIGEE_X +102 | # organizationName: Must be reported as a missing required prop Error was generated by the configuration spec rule. -[30] .redocly.yaml:101:7 at #/developerOnboarding/adapters/1 +[31] .redocly.yaml:100:7 at #/developerOnboarding/adapters/1 The field \`auth\` must be present on this level. - 99 | adapters: -100 | - should be object -101 | - type: 123 # Must be a string + 98 | adapters: + 99 | - should be object +100 | - type: 123 # Must be a string | ^^^^^^^^^ -102 | - type: APIGEE_X -103 | # organizationName: Must be reported as a missing required prop +101 | - type: APIGEE_X +102 | # organizationName: Must be reported as a missing required prop Error was generated by the configuration spec rule. -[31] .redocly.yaml:101:13 at #/developerOnboarding/adapters/1/type +[32] .redocly.yaml:100:13 at #/developerOnboarding/adapters/1/type Expected type \`string\` but got \`integer\`. - 99 | adapters: -100 | - should be object -101 | - type: 123 # Must be a string + 98 | adapters: + 99 | - should be object +100 | - type: 123 # Must be a string | ^^^ -102 | - type: APIGEE_X -103 | # organizationName: Must be reported as a missing required prop +101 | - type: APIGEE_X +102 | # organizationName: Must be reported as a missing required prop Error was generated by the configuration spec rule. -[32] .redocly.yaml:102:7 at #/developerOnboarding/adapters/2 +[33] .redocly.yaml:101:7 at #/developerOnboarding/adapters/2 The field \`organizationName\` must be present on this level. -100 | - should be object -101 | - type: 123 # Must be a string -102 | - type: APIGEE_X + 99 | - should be object +100 | - type: 123 # Must be a string +101 | - type: APIGEE_X | ^^^^^^^^^^^^^^ -103 | # organizationName: Must be reported as a missing required prop +102 | # organizationName: Must be reported as a missing required prop | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ … | < 5 more lines > -109 | not-expected: Must fail +108 | not-expected: Must fail | ^^^^^^^^^^^^^^^^^^^^^^^ -110 | - type: APIGEE_X -111 | organizationName: Test +109 | - type: APIGEE_X +110 | organizationName: Test Error was generated by the configuration spec rule. -[33] .redocly.yaml:104:7 at #/developerOnboarding/adapters/2/auth +[34] .redocly.yaml:103:7 at #/developerOnboarding/adapters/2/auth The field \`tokenEndpoint\` must be present on this level. -102 | - type: APIGEE_X -103 | # organizationName: Must be reported as a missing required prop -104 | auth: +101 | - type: APIGEE_X +102 | # organizationName: Must be reported as a missing required prop +103 | auth: | ^^^^ -105 | type: OAUTH2 -106 | # tokenEndpoint: Must be reported as a missing required prop +104 | type: OAUTH2 +105 | # tokenEndpoint: Must be reported as a missing required prop Error was generated by the configuration spec rule. -[34] .redocly.yaml:107:19 at #/developerOnboarding/adapters/2/auth/clientId +[35] .redocly.yaml:106:19 at #/developerOnboarding/adapters/2/auth/clientId Expected type \`string\` but got \`integer\`. -105 | type: OAUTH2 -106 | # tokenEndpoint: Must be reported as a missing required prop -107 | clientId: 456 # Must be a string +104 | type: OAUTH2 +105 | # tokenEndpoint: Must be reported as a missing required prop +106 | clientId: 456 # Must be a string | ^^^ -108 | clientSecret: '{{ process.env.secret }}' -109 | not-expected: Must fail +107 | clientSecret: '{{ process.env.secret }}' +108 | not-expected: Must fail Error was generated by the configuration spec rule. -[35] .redocly.yaml:109:9 at #/developerOnboarding/adapters/2/auth/not-expected +[36] .redocly.yaml:108:9 at #/developerOnboarding/adapters/2/auth/not-expected Property \`not-expected\` is not expected here. -107 | clientId: 456 # Must be a string -108 | clientSecret: '{{ process.env.secret }}' -109 | not-expected: Must fail +106 | clientId: 456 # Must be a string +107 | clientSecret: '{{ process.env.secret }}' +108 | not-expected: Must fail | ^^^^^^^^^^^^ -110 | - type: APIGEE_X -111 | organizationName: Test +109 | - type: APIGEE_X +110 | organizationName: Test Error was generated by the configuration spec rule. -[36] .redocly.yaml:112:7 at #/developerOnboarding/adapters/3/auth +[37] .redocly.yaml:111:7 at #/developerOnboarding/adapters/3/auth The field \`serviceAccountPrivateKey\` must be present on this level. -110 | - type: APIGEE_X -111 | organizationName: Test -112 | auth: +109 | - type: APIGEE_X +110 | organizationName: Test +111 | auth: | ^^^^ -113 | type: SERVICE_ACCOUNT -114 | # serviceAccountPrivateKey: Must be reported as a missing required prop +112 | type: SERVICE_ACCOUNT +113 | # serviceAccountPrivateKey: Must be reported as a missing required prop Error was generated by the configuration spec rule. -[37] .redocly.yaml:115:30 at #/developerOnboarding/adapters/3/auth/serviceAccountEmail +[38] .redocly.yaml:114:30 at #/developerOnboarding/adapters/3/auth/serviceAccountEmail Expected type \`string\` but got \`integer\`. -113 | type: SERVICE_ACCOUNT -114 | # serviceAccountPrivateKey: Must be reported as a missing required prop -115 | serviceAccountEmail: 789 # Must be a string +112 | type: SERVICE_ACCOUNT +113 | # serviceAccountPrivateKey: Must be reported as a missing required prop +114 | serviceAccountEmail: 789 # Must be a string | ^^^ -116 | -117 | l10n: +115 | +116 | l10n: Error was generated by the configuration spec rule. -[38] .redocly.yaml:120:13 at #/l10n/locales/0/code +[39] .redocly.yaml:119:13 at #/l10n/locales/0/code Expected type \`string\` but got \`integer\`. -118 | defaultLocale: en-US -119 | locales: -120 | - code: 123 # Must be a string +117 | defaultLocale: en-US +118 | locales: +119 | - code: 123 # Must be a string | ^^^ -121 | name: English -122 | - code: es-ES +120 | name: English +121 | - code: es-ES Error was generated by the configuration spec rule. -[39] .redocly.yaml:133:12 at #/env/some-env/mockServer/off +[40] .redocly.yaml:132:12 at #/env/some-env/mockServer/off Expected type \`boolean\` but got \`string\`. -131 | some-env: -132 | mockServer: -133 | off: must be boolean +130 | some-env: +131 | mockServer: +132 | off: must be boolean | ^^^^^^^^^^^^^^^ -134 | not-expected: Must fail -135 | apis: +133 | not-expected: Must fail +134 | apis: Error was generated by the configuration spec rule. -[40] .redocly.yaml:134:7 at #/env/some-env/mockServer/not-expected +[41] .redocly.yaml:133:7 at #/env/some-env/mockServer/not-expected Property \`not-expected\` is not expected here. -132 | mockServer: -133 | off: must be boolean -134 | not-expected: Must fail +131 | mockServer: +132 | off: must be boolean +133 | not-expected: Must fail | ^^^^^^^^^^^^ -135 | apis: -136 | no-root: +134 | apis: +135 | no-root: Error was generated by the configuration spec rule. -[41] .redocly.yaml:136:7 at #/env/some-env/apis/no-root +[42] .redocly.yaml:135:7 at #/env/some-env/apis/no-root The field \`root\` must be present on this level. -134 | not-expected: Must fail -135 | apis: -136 | no-root: +133 | not-expected: Must fail +134 | apis: +135 | no-root: | ^^^^^^^ -137 | # root: Must be defined -138 | rules: {} +136 | # root: Must be defined +137 | rules: {} Error was generated by the configuration spec rule. -[42] .redocly.yaml:140:15 at #/env/some-env/apis/wrong-root/root +[43] .redocly.yaml:139:15 at #/env/some-env/apis/wrong-root/root Expected type \`string\` but got \`integer\`. -138 | rules: {} -139 | wrong-root: -140 | root: 789 # Must be a string +137 | rules: {} +138 | wrong-root: +139 | root: 789 # Must be a string | ^^^ -141 | -142 | referenced-env: +140 | +141 | referenced-env: Error was generated by the configuration spec rule. -[43] env.yaml:2:5 at #/ignore/0 +[44] env.yaml:2:5 at #/ignore/0 Expected type \`string\` but got \`integer\`. @@ -613,12 +627,12 @@ Expected type \`string\` but got \`integer\`. 3 | - correct 4 | -referenced from .redocly.yaml:143:5 at #/env/referenced-env +referenced from .redocly.yaml:142:5 at #/env/referenced-env Error was generated by the configuration spec rule. -❌ Your config has 43 errors. +❌ Your config has 44 errors. `; diff --git a/__tests__/lint-config/config-with-refs-extended/.redocly.yaml b/__tests__/lint-config/config-with-refs-extended/.redocly.yaml index f455f7d1..082667d1 100644 --- a/__tests__/lint-config/config-with-refs-extended/.redocly.yaml +++ b/__tests__/lint-config/config-with-refs-extended/.redocly.yaml @@ -6,9 +6,8 @@ apis: rules: $ref: ./rules.yaml -theme: - openapi: - $ref: theme-openapi.yaml +openapi: + $ref: theme-openapi.yaml organization: false # wrong, expected string diff --git a/__tests__/lint-config/config-with-refs-extended/snapshot.js b/__tests__/lint-config/config-with-refs-extended/snapshot.js index 19514d98..bc8a3ed2 100644 --- a/__tests__/lint-config/config-with-refs-extended/snapshot.js +++ b/__tests__/lint-config/config-with-refs-extended/snapshot.js @@ -14,16 +14,16 @@ Property \`unexpected-property\` is not expected here. Error was generated by the configuration spec rule. -[2] .redocly.yaml:13:15 at #/organization +[2] .redocly.yaml:12:15 at #/organization Expected type \`string\` but got \`boolean\`. -11 | $ref: theme-openapi.yaml -12 | -13 | organization: false # wrong, expected string +10 | $ref: theme-openapi.yaml +11 | +12 | organization: false # wrong, expected string | ^^^^^ -14 | -15 | seo: +13 | +14 | seo: Error was generated by the configuration spec rule. @@ -36,7 +36,7 @@ Expected type \`string\` but got \`integer\`. | ^^^ 2 | -referenced from .redocly.yaml:16:3 at #/seo +referenced from .redocly.yaml:15:3 at #/seo Error was generated by the configuration spec rule. diff --git a/__tests__/lint-config/config-with-refs/.redocly.yaml b/__tests__/lint-config/config-with-refs/.redocly.yaml index f28574ff..f1fa4f10 100644 --- a/__tests__/lint-config/config-with-refs/.redocly.yaml +++ b/__tests__/lint-config/config-with-refs/.redocly.yaml @@ -6,6 +6,5 @@ apis: non-existing-root-property: Fail -theme: - openapi: - $ref: ./theme-openapi.yaml#/content +openapi: + $ref: ./theme-openapi.yaml#/content diff --git a/__tests__/lint-config/config-with-refs/snapshot.js b/__tests__/lint-config/config-with-refs/snapshot.js index d31cb1ef..4fb1e8ad 100644 --- a/__tests__/lint-config/config-with-refs/snapshot.js +++ b/__tests__/lint-config/config-with-refs/snapshot.js @@ -11,7 +11,7 @@ Property \`non-existing-root-property\` is not expected here. 7 | non-existing-root-property: Fail | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 8 | -9 | theme: +9 | openapi: Warning was generated by the configuration spec rule. diff --git a/__tests__/lint/deprecated-apiDefinitions/snapshot.js b/__tests__/lint/deprecated-apiDefinitions/snapshot.js index 7203139a..e5c05e3e 100644 --- a/__tests__/lint/deprecated-apiDefinitions/snapshot.js +++ b/__tests__/lint/deprecated-apiDefinitions/snapshot.js @@ -21,7 +21,9 @@ Warning was generated by the configuration spec rule. Property \`lint\` is not expected here. Did you mean: + - links - l10n + - logo - env 2 | main: ./openapi.yaml diff --git a/__tests__/lint/deprecated-lint/snapshot.js b/__tests__/lint/deprecated-lint/snapshot.js index 95abd4e2..fd24be72 100644 --- a/__tests__/lint/deprecated-lint/snapshot.js +++ b/__tests__/lint/deprecated-lint/snapshot.js @@ -8,7 +8,9 @@ The 'lint' field is deprecated. Read more about this change: https://redocly.com Property \`lint\` is not expected here. Did you mean: + - links - l10n + - logo - env 6 | operation-4xx-response: error diff --git a/package-lock.json b/package-lock.json index d9112b56..25c6d400 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3525,9 +3525,9 @@ "link": true }, "node_modules/@redocly/config": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@redocly/config/-/config-0.9.0.tgz", - "integrity": "sha512-rRd0pSiPC68AQGud2VbrHqUov1VHospfcYE2pFYmGYfZhzZfHBSiVaeiTY+CZmrhf5RB9aVdOHRCm25Vb6GFkQ==" + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@redocly/config/-/config-0.10.0.tgz", + "integrity": "sha512-oFP8SL9qmsJ2QxwvOjI/h87hHMKq8G/RUbTSxF9/r4vbllCxzQ8Tla3xfUO/lGVVO6gZsAIsuJGXhaDagd4msg==" }, "node_modules/@redocly/openapi-core": { "resolved": "packages/core", @@ -13814,7 +13814,7 @@ "license": "MIT", "dependencies": { "@redocly/ajv": "^8.11.0", - "@redocly/config": "^0.9.0", + "@redocly/config": "^0.10.0", "colorette": "^1.2.0", "https-proxy-agent": "^7.0.4", "js-levenshtein": "^1.1.6", @@ -16516,15 +16516,15 @@ } }, "@redocly/config": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@redocly/config/-/config-0.9.0.tgz", - "integrity": "sha512-rRd0pSiPC68AQGud2VbrHqUov1VHospfcYE2pFYmGYfZhzZfHBSiVaeiTY+CZmrhf5RB9aVdOHRCm25Vb6GFkQ==" + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@redocly/config/-/config-0.10.0.tgz", + "integrity": "sha512-oFP8SL9qmsJ2QxwvOjI/h87hHMKq8G/RUbTSxF9/r4vbllCxzQ8Tla3xfUO/lGVVO6gZsAIsuJGXhaDagd4msg==" }, "@redocly/openapi-core": { "version": "file:packages/core", "requires": { "@redocly/ajv": "^8.11.0", - "@redocly/config": "^0.9.0", + "@redocly/config": "^0.10.0", "@types/js-levenshtein": "^1.1.0", "@types/js-yaml": "^4.0.3", "@types/lodash.isequal": "^4.5.5", diff --git a/packages/core/package.json b/packages/core/package.json index 8bc02d5a..b368c33b 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -36,7 +36,7 @@ ], "dependencies": { "@redocly/ajv": "^8.11.0", - "@redocly/config": "^0.9.0", + "@redocly/config": "^0.10.0", "colorette": "^1.2.0", "https-proxy-agent": "^7.0.4", "js-levenshtein": "^1.1.6",