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

Referenced schemas in callback responses are not resolved [Regression in 2.1.19] #2110

Open
simon-spinner opened this issue Jul 10, 2024 · 0 comments

Comments

@simon-spinner
Copy link

Input
Given the following OpenAPI specs:

openapi.yaml

openapi: 3.0.2
info:
  title: But
  version: 1.0.0
paths:
    '/resource':
      $ref: operation.yaml#/paths/~1resource

operation.yaml

openapi: 3.0.2
info:
  title: But
  version: 1.0.0
paths:
  '/resource':
    get:
      operationId: Operation
      responses:
        '200':
          description: Operation was Successfull and the below response structure is returned
      callbacks:
        SomeCallback:
          '/callback':
            get:
              responses:
                '200':
                  description: Success
                  content:
                    application/json:
                      schema:
                        $ref: '#/components/schemas/Response'
components:
  schemas:
    Response:
      type: object
      properties:
        name:
          type: string

parsing with

var options = new ParseOptions();
options.setResolve(true);
var result = new OpenAPIParser().readLocation("openapi.yaml", null, options);

Expected result:
The result contains the Response schema in components.schemas.

Observed result:
The Response schema is missing. This worked as expected until including 2.1.18 and is broken afterwards.

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

No branches or pull requests

1 participant