Skip to content

Commit

Permalink
feat: removed descriptions and added info.title as group names for x-…
Browse files Browse the repository at this point in the history
…tagGroup in Join command (#1394)

* chore: removed description for x-tagGroups for Join command

* chore: updated snapshots

* feat: replaced file names with `info.title` as group names in x-tagGroups for the `join` command

* fix: changeset fix from patch to minor update

---------

Co-authored-by: Mateusz Lis <[email protected]>
  • Loading branch information
o-bbk and malis42 authored Feb 2, 2024
1 parent 7ce9013 commit 8bff6a8
Show file tree
Hide file tree
Showing 39 changed files with 111 additions and 115 deletions.
6 changes: 6 additions & 0 deletions .changeset/grumpy-toys-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@redocly/cli": minor
---

- Removed descriptions adding for x-tagGroups for the `join` command. Descriptions in x-tagGroups are not supported and cause errors on linting.
- Updated `info.title` to be used as a name in x-tagGroups instead of a file name for the `join` command, so you can now join files with the same names.
2 changes: 1 addition & 1 deletion __tests__/join/decorate/bar.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
openapi: 3.0.0
info:
title: Example API
title: Bar Example API
description: This is an example API.
version: 1.0.0
servers:
Expand Down
2 changes: 1 addition & 1 deletion __tests__/join/decorate/foo.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
openapi: 3.0.0
info:
title: Example API
title: Foo Example API
description: This is an example API.
version: 1.0.0
servers:
Expand Down
4 changes: 2 additions & 2 deletions __tests__/join/decorate/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`E2E join with options test with option: { name: 'decorate', value: true
openapi: 3.0.0
info:
title: Example API
title: Foo Example API
description: This is an example API.
version: 1.0.0
servers:
Expand Down Expand Up @@ -46,7 +46,7 @@ paths:
- bar_other
components: {}
x-tagGroups:
- name: bar
- name: Bar Example API
tags:
- bar_other
Expand Down
2 changes: 1 addition & 1 deletion __tests__/join/ignore-decorators/bar.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
openapi: 3.0.0
info:
title: Example API
title: Bar Example API
description: This is an example API.
version: 1.0.0
servers:
Expand Down
2 changes: 1 addition & 1 deletion __tests__/join/ignore-decorators/foo.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
openapi: 3.0.0
info:
title: Example API
title: Foo Example API
description: This is an example API.
version: 1.0.0
servers:
Expand Down
6 changes: 3 additions & 3 deletions __tests__/join/ignore-decorators/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`E2E join without options test: ignore-decorators 1`] = `
openapi: 3.0.0
info:
title: Example API
title: Foo Example API
description: This is an example API.
version: 1.0.0
servers:
Expand Down Expand Up @@ -58,10 +58,10 @@ paths:
- bar_other
components: {}
x-tagGroups:
- name: foo
- name: Foo Example API
tags:
- foo_other
- name: bar
- name: Bar Example API
tags:
- bar_other
Expand Down
2 changes: 1 addition & 1 deletion __tests__/join/json-and-yaml-input/bar.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
openapi: 3.0.0
info:
title: Example API
title: Bar Example API
description: This is an example API.
version: 1.0.0
servers:
Expand Down
2 changes: 1 addition & 1 deletion __tests__/join/json-and-yaml-input/foo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"openapi": "3.0.0",
"info": {
"title": "Example API",
"title": "Foo Example API",
"description": "This is an example API.",
"version": "1.0.0"
},
Expand Down
6 changes: 3 additions & 3 deletions __tests__/join/json-and-yaml-input/json-output.snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exports[`E2E join files with different extensions test with option: {
{
"openapi": "3.0.0",
"info": {
"title": "Example API",
"title": "Foo Example API",
"description": "This is an example API.",
"version": "<version>"
},
Expand Down Expand Up @@ -98,13 +98,13 @@ exports[`E2E join files with different extensions test with option: {
"components": {},
"x-tagGroups": [
{
"name": "foo",
"name": "Foo Example API",
"tags": [
"foo_other"
]
},
{
"name": "bar",
"name": "Bar Example API",
"tags": [
"bar_other"
]
Expand Down
6 changes: 3 additions & 3 deletions __tests__/join/json-and-yaml-input/yaml-output.snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`E2E join files with different extensions test with option: {
openapi: 3.0.0
info:
title: Example API
title: Bar Example API
description: This is an example API.
version: 1.0.0
servers:
Expand Down Expand Up @@ -63,10 +63,10 @@ paths:
- foo_other
components: {}
x-tagGroups:
- name: bar
- name: Bar Example API
tags:
- bar_other
- name: foo
- name: Foo Example API
tags:
- foo_other
Expand Down
3 changes: 1 addition & 2 deletions __tests__/join/multi-references-to-one-file/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,11 @@ components:
subFoo:
$ref: '#/components/schemas/FooObject'
x-tagGroups:
- name: foo
- name: Sample API
tags:
- GetSingleFoo
- Foo
- foo_other
description: My sample api
- name: bar
tags:
- CreateBar
Expand Down
2 changes: 1 addition & 1 deletion __tests__/join/multiple-tags-in-same-files/bar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tags:
description: Wild description
info:
version: 1.0.0
title: Example OpenAPI 3 definition.
title: Bar Example OpenAPI 3 definition.
description: Information about API
license:
name: MIT
Expand Down
2 changes: 1 addition & 1 deletion __tests__/join/multiple-tags-in-same-files/foo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tags:
description: Store tags
info:
version: 1.0.0
title: Example OpenAPI 3 definition.
title: Foo Example OpenAPI 3 definition.
description: Information about API
license:
name: MIT
Expand Down
8 changes: 3 additions & 5 deletions __tests__/join/multiple-tags-in-same-files/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`E2E join without options test: multiple-tags-in-same-files 1`] = `
openapi: 3.0.0
info:
version: 1.0.0
title: Example OpenAPI 3 definition.
title: Foo Example OpenAPI 3 definition.
description: Information about API
license:
name: MIT
Expand Down Expand Up @@ -71,16 +71,14 @@ paths:
description: example description
components: {}
x-tagGroups:
- name: foo
- name: Foo Example OpenAPI 3 definition.
tags:
- Store
- foo_other
description: Information about API
- name: bar
- name: Bar Example OpenAPI 3 definition.
tags:
- Pets
- Dog
description: Information about API
openapi.yaml: join processed in <test>ms
Expand Down
2 changes: 1 addition & 1 deletion __tests__/join/prefix-components-with-info-prop/bar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tags:
description: Bar Discription
info:
version: 1.0.0
title: Example OpenAPI 3 definition.
title: Bar Example OpenAPI 3 definition.
description: Information about API
license:
name: MIT
Expand Down
2 changes: 1 addition & 1 deletion __tests__/join/prefix-components-with-info-prop/foo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tags:
description: Foo Discription
info:
version: 1.0.0
title: Example OpenAPI 3 definition foo.
title: Foo Example OpenAPI 3 definition foo.
description: Information about API
license:
name: MIT
Expand Down
12 changes: 5 additions & 7 deletions __tests__/join/prefix-components-with-info-prop/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`E2E join with options test with option: { name: 'prefix-components-with
openapi: 3.0.0
info:
version: 1.0.0
title: Example OpenAPI 3 definition foo.
title: Foo Example OpenAPI 3 definition foo.
description: Information about API
license:
name: MIT
Expand Down Expand Up @@ -52,23 +52,21 @@ paths:
- bar_other
components:
schemas:
Example OpenAPI 3 definition foo._some-property:
Foo Example OpenAPI 3 definition foo._some-property:
description: foo description
type: string
Example OpenAPI 3 definition._some-property:
Bar Example OpenAPI 3 definition._some-property:
description: bar description
type: string
x-tagGroups:
- name: foo
- name: Foo Example OpenAPI 3 definition foo.
tags:
- Foo
- foo_other
description: Information about API
- name: bar
- name: Bar Example OpenAPI 3 definition.
tags:
- Bar
- bar_other
description: Information about API
openapi.yaml: join processed in <test>ms
Expand Down
2 changes: 1 addition & 1 deletion __tests__/join/prefix-tags-with-filename/bar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tags:
description: Pet Discription
info:
version: 1.0.0
title: Example OpenAPI 3 definition.
title: Bar Example OpenAPI 3 definition.
description: Information about API
license:
name: MIT
Expand Down
2 changes: 1 addition & 1 deletion __tests__/join/prefix-tags-with-filename/foo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tags:
description: Pet Discription
info:
version: 1.0.0
title: Example OpenAPI 3 definition.
title: Foo Example OpenAPI 3 definition.
description: Information about API
license:
name: MIT
Expand Down
8 changes: 3 additions & 5 deletions __tests__/join/prefix-tags-with-filename/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`E2E join with options test with option: { name: 'prefix-tags-with-filen
openapi: 3.0.0
info:
version: 1.0.0
title: Example OpenAPI 3 definition.
title: Foo Example OpenAPI 3 definition.
description: Information about API
license:
name: MIT
Expand Down Expand Up @@ -52,16 +52,14 @@ paths:
- bar_other
components: {}
x-tagGroups:
- name: foo
- name: Foo Example OpenAPI 3 definition.
tags:
- foo_Pet
- foo_other
description: Information about API
- name: bar
- name: Bar Example OpenAPI 3 definition.
tags:
- bar_Pet
- bar_other
description: Information about API
openapi.yaml: join processed in <test>ms
Expand Down
2 changes: 1 addition & 1 deletion __tests__/join/prefix-tags-with-info-prop/bar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tags:
description: Pet Discription
info:
version: 1.0.0
title: Example OpenAPI 3 definition.
title: Bar Example OpenAPI 3 definition.
description: Information about API
license:
name: MIT
Expand Down
2 changes: 1 addition & 1 deletion __tests__/join/prefix-tags-with-info-prop/foo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tags:
description: Pet Discription
info:
version: 1.0.0
title: Example OpenAPI 3 definition with foo title.
title: Foo Example OpenAPI 3 definition with foo title.
description: Information about API
license:
name: MIT
Expand Down
28 changes: 13 additions & 15 deletions __tests__/join/prefix-tags-with-info-prop/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ exports[`E2E join with options test with option: { name: 'prefix-tags-with-info-
openapi: 3.0.0
info:
version: 1.0.0
title: Example OpenAPI 3 definition with foo title.
title: Foo Example OpenAPI 3 definition with foo title.
description: Information about API
license:
name: MIT
url: https://opensource.org/licenses/MIT
servers:
- url: https://redocly.com/v1
tags:
- name: Example OpenAPI 3 definition with foo title._Pet
- name: Foo Example OpenAPI 3 definition with foo title._Pet
description: Pet Discription
x-displayName: Pet
- name: Example OpenAPI 3 definition with foo title._other
- name: Foo Example OpenAPI 3 definition with foo title._other
x-displayName: other
- name: Example OpenAPI 3 definition._Pet
- name: Bar Example OpenAPI 3 definition._Pet
description: Pet Discription
x-displayName: Pet
- name: Example OpenAPI 3 definition._other
- name: Bar Example OpenAPI 3 definition._other
x-displayName: other
paths:
/pets:
Expand All @@ -40,7 +40,7 @@ paths:
'200':
description: example description
tags:
- Example OpenAPI 3 definition with foo title._other
- Foo Example OpenAPI 3 definition with foo title._other
/pets/{petId}:
post:
summary: summary example
Expand All @@ -49,19 +49,17 @@ paths:
'201':
description: example description
tags:
- Example OpenAPI 3 definition._other
- Bar Example OpenAPI 3 definition._other
components: {}
x-tagGroups:
- name: foo
- name: Foo Example OpenAPI 3 definition with foo title.
tags:
- Example OpenAPI 3 definition with foo title._Pet
- Example OpenAPI 3 definition with foo title._other
description: Information about API
- name: bar
- Foo Example OpenAPI 3 definition with foo title._Pet
- Foo Example OpenAPI 3 definition with foo title._other
- name: Bar Example OpenAPI 3 definition.
tags:
- Example OpenAPI 3 definition._Pet
- Example OpenAPI 3 definition._other
description: Information about API
- Bar Example OpenAPI 3 definition._Pet
- Bar Example OpenAPI 3 definition._other
openapi.yaml: join processed in <test>ms
Expand Down
2 changes: 1 addition & 1 deletion __tests__/join/reference-in-description/bar.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: 3.0.0
info:
version: 1.0.0
title: Example OpenAPI 3 definition.
title: Bar Example OpenAPI 3 definition.
description: Information about API
license:
name: MIT
Expand Down
Loading

1 comment on commit 8bff6a8

@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 76.08% 4301/5653
🟡 Branches 65.73% 2233/3397
🟡 Functions 68.71% 694/1010
🟡 Lines 76.29% 4044/5301

Test suite run success

699 tests passing in 100 suites.

Report generated by 🧪jest coverage report action from 8bff6a8

Please sign in to comment.