Skip to content

Resolver error: Could not resolve reference: Could not resolve pointer: #9922

Open

Description

@avrahamGross
  • OS: macOS
  • Browser: chrome, safari, firefox
  • Version: [e.g. 22]
  • Method of installation: npm
  • Swagger-UI version: > 5.17.2
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

openapi: 3.0.0
info:
  title: Test API
  description: test spec
  version: 0.0.1
paths:
  /test/v1/endpoint:
    get:
      parameters:
      - $ref: http://localhost:3000/oas/test-domain-v1~0.0.1.yaml#/components/parameters/A
      - $ref: http://localhost:3000/oas/test-domain-v1~0.0.1.yaml#/components/parameters/B
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: http://localhost:3000/oas/test-domain-v1~0.0.1.yaml#/components/parameters/A

Describe the bug you're encountering

I have refs retrieved through an API endpoint. They are properly returned and resolved inside the editor. However, swagger-ui has a problem resolving them.
When expanding an operation an error displays:

Resolver error at paths./test/v1/endpoint.get.parameters.0.$ref
Could not resolve reference: Could not resolve pointer: /components/parameters/A does not exist in document

Screenshots

Screenshot 2024-05-07 at 1 15 24 PM

Expected behavior

Additional context or thoughts

Interestingly, when added the reference files to the public folder and referencing them through there, there is no error. However it is undesirable to require a new build every time a ref is modified or added to the referenced file.

Screenshot 2024-05-07 at 1 16 49 PM

Activity

  1. ritikmodi commented on Aug 31, 2024

    @ritikmodi

    Hey avrahamGross, were you able to solve the issue? I am also facing the same issue. Could you please help me with the solution. Thanks.

  2. avrahamGross commented on Sep 10, 2024

    @avrahamGross
    Author

    ritikmodi I can't say I solved it but I did bypass it. I wrapped the updateJsonSpec action with a custom resolver function and passed that resolved object to the swagger ui component. Hope this helps!

  3. sabuhiteymurov commented on Dec 11, 2024

    @sabuhiteymurov

    Is there any progress on this issue? I'm also encountering it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions