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

fix: x-displayName & x-tagGroups cancel eachother out, fix #1719 #1725

Merged
merged 1 commit into from
May 15, 2024

Conversation

hanspagel
Copy link
Member

@hanspagel hanspagel commented May 14, 2024

Currently, x-displayName and x-tagGroups don’t play well with each other, see #1719.

This PR fixes it. Instead of overwriting the name, and breaking the logic of what belongs to which tag, we’ll just keep an optional displayTitle which is used to overwrite title (if needed).

Example

openapi: 3.1.0
info:
  title: Tag groups example
x-tagGroups:
  - name: fruits
    tags:
      - fruitPrice
  - name: vegetables
    tags:
      - vegetablePrice
tags:
  - name: fruitPrice
    x-displayName: price
  - name: vegetablePrice
    x-displayName: price
paths:
  '/fruit/price':
    get:
      tags:
        - fruitPrice
      summary: Get fruit price

  '/vegetable/price':
    get:
      tags:
        - vegetablePrice
      summary: Get vegatable price

Result

Screenshot 2024-05-14 at 12 03 42

@hanspagel hanspagel requested a review from marclave as a code owner May 14, 2024 10:03
Copy link

changeset-bot bot commented May 14, 2024

🦋 Changeset detected

Latest commit: 82bcbb6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@scalar/api-reference Patch
@scalar/api-reference-react Patch
@scalar/cli Patch
@scalar/express-api-reference Patch
@scalar/fastify-api-reference Patch
@scalar/hono-api-reference Patch
@scalar/nestjs-api-reference Patch
@scalar/nextjs-api-reference Patch
@scalar/nuxt Patch
@scalar/play-button Patch
@scalar/docusaurus Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

relativeci bot commented May 14, 2024

#1540 Bundle Size — 1.8MiB (~+0.01%).

82bcbb6(current) vs 7dd3231 main#1536(baseline)

Warning

Bundle contains 4 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
#1540
     Baseline
#1536
Regression  Initial JS 1.8MiB(~+0.01%) 1.8MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 100% 0%
No change  Chunks 1 1
No change  Assets 1 1
No change  Modules 1073 1073
No change  Duplicate Modules 0 0
No change  Duplicate Code 0% 0%
No change  Packages 160 160
No change  Duplicate Packages 4 4
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#1540
     Baseline
#1536
Regression  JS 1.8MiB (~+0.01%) 1.8MiB

Bundle analysis reportBranch fix/x-display-name-and-x-tag-gro...Project dashboard

Copy link

@edorgeville edorgeville left a comment

Choose a reason for hiding this comment

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

Didn't expect to wake up to see my issue already fixed, thank you!
I had a look at the changes and tested the preview deployment, everything LGTM :)

Copy link
Member

@marclave marclave left a comment

Choose a reason for hiding this comment

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

✨ nice reporting @edorgeville and awesome fix @hanspagel !

@marclave
Copy link
Member

ah! some conflicts @hanspagel then we can get this in ✨

@hanspagel hanspagel force-pushed the fix/x-display-name-and-x-tag-group branch from 90a9fb4 to 82bcbb6 Compare May 15, 2024 09:39
Copy link
Contributor

@hanspagel hanspagel merged commit 64cc35f into main May 15, 2024
10 checks passed
@hanspagel hanspagel deleted the fix/x-display-name-and-x-tag-group branch May 15, 2024 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants