Skip to content

Conversation

hotsoycandy
Copy link

@hotsoycandy hotsoycandy commented Feb 24, 2025

Description

Extract tag properly when there's a slash in the tag

For example. when the tag is "my-service/common", the deep link is not working for now.

the issue(#5875) that describes this bug also exists.

Motivation and Context

Deep linking is not working when I write a tag with slash.

How Has This Been Tested?

Yes. In my local environment.

openapi: 3.0.0
paths:
  /health:
    get:
      operationId: HealthController_check
      parameters: []
      responses:
        '200':
          description: The Health Check is successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  info:
                    type: object
                    example:
                      database:
                        status: up
                    additionalProperties:
                      type: object
                      required:
                        - status
                      properties:
                        status:
                          type: string
                      additionalProperties: true
                    nullable: true
                  error:
                    type: object
                    example: {}
                    additionalProperties:
                      type: object
                      required:
                        - status
                      properties:
                        status:
                          type: string
                      additionalProperties: true
                    nullable: true
                  details:
                    type: object
                    example:
                      database:
                        status: up
                    additionalProperties:
                      type: object
                      required:
                        - status
                      properties:
                        status:
                          type: string
                      additionalProperties: true
      tags:
        - my-service/common
info:
  title: Supplier service
  description: ''
  version: '3.0'
  contact: {}
tags: []
components:
  schemas: {}

Screenshots (if appropriate):

The link that I used for test: http://localhost:3101/api-docs#/my-service%2Fcommon/HealthController_check

I fixed and tested it locally with chrome source override

before
before

after
after

Checklist

My PR contains...

  • No code changes (src/ is unmodified: changes to documentation, CI, metadata, etc.)
  • Dependency changes (any modification to dependencies in package.json)
  • Bug fixes (non-breaking change which fixes an issue)
  • Improvements (misc. changes to existing features)
  • Features (non-breaking change which adds functionality)

My changes...

  • are breaking changes to a public API (config options, System API, major UI change, etc).
  • are breaking changes to a private API (Redux, component props, utility functions, etc.).
  • are breaking changes to a developer API (npm script behavior changes, new dev system dependencies, etc).
  • are not breaking changes.

Documentation

  • My changes do not require a change to the project documentation.
  • My changes require a change to the project documentation.
  • If yes to above: I have updated the documentation accordingly.

Automated tests

  • My changes can not or do not need to be tested.
  • My changes can and should be tested by unit and/or integration tests.
  • If yes to above: I have added tests to cover my changes.
  • If yes to above: I have taken care to cover edge cases in my tests.
  • All new and existing tests passed.

@ponelat ponelat added type: bug P3 cat: deep linking pull-request-welcome If a PR were to be made, we would help get it merged labels Feb 28, 2025
@Mathias02
Copy link

I tested this with a change in the docs/samples/src/swagger-config.yaml where I changed pet/list to pet-list,
this is the snippet
tags:

  • name: "pet-list"
    description: "Everything about your Pets"

paths:
/pet:
get:
tags:
- "pet-list"
summary: "Returns all pets"
responses:
"200":
description: OK,

and also changed the url in dist/swagger-initializer.js to
url: "./openapi.yaml",
for testing purposes and this worked.

@lukaszzazulak
Copy link
Contributor

@hotsoycandy looks good! could you add test for the changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat: deep linking P3 pull-request-welcome If a PR were to be made, we would help get it merged type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants