Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support joining of multiple existing x-tagGroups in join command #1707

Open
StephenBeirlaen opened this issue Sep 2, 2024 · 0 comments
Open

Comments

@StephenBeirlaen
Copy link

Is your feature request related to a problem? Please describe.

I have two or more microservices that each have their own OpenAPI specification file. I aimed to join them together to build the complete API specification.
Each service has its own tags and x-tagGroups configuration. I could not find a way to retain & merge the existing x-tagGroups from all specifications together. They are either regenerated and all tags are grouped by specification name, or just ignored, depending on the --without-x-tag-groups option.

Describe the solution you'd like

I would like the final output to contain a unique list of all tag groups of every specification.
If the same tag group exists within different specifications, I would like to see their tags merged together.
I think that duplicate tags should not cause a "conflict" in this new scenario.

Maybe the current behaviour can be kept by introducing this new behaviour as a new option, or vice versa?

Describe alternatives you've considered

There is the option --without-x-tag-groups:

  • If not set, it will merge all tags and group them into a x-tagGroup which is based on the specification name.
  • If set, it will skip the above automated creation of x-tagGroups. Unfortunately, the x-tagGroups property is then not created in the joined file at all

Unfortunately this means that the existing x-tagGroups information is not used. Furthermore, you always see a warning:

warning: x-tagGroups at src/services/common/openapi.yaml will be skipped

Additional context

Example (merge A + B together, with a duplicate x-tagGroup Invoicing:

Specification A:

tags:
  - name: contacts
    description: Contacts
  - name: companies
    description: Companies
  - name: invoices
    description: Invoices
x-tagGroups:
  - name: CRM
    tags:
      - contacts
      - companies
  - name: Invoicing
    tags:
      - invoices

Specification B:

tags:
  - name: credit_notes
    description: Credit Notes
x-tagGroups:
  - name: Invoicing
    tags:
      - credit_notes

Intended result:

tags:
  - name: contacts
    description: Contacts
  - name: companies
    description: Companies
  - name: invoices
    description: Invoices
  - name: credit_notes
    description: Credit Notes
x-tagGroups:
  - name: CRM
    tags:
      - contacts
      - companies
  - name: Invoicing
    tags:
      - invoices
      - credit_notes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant