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

Wrong escaping when using merge #1238

Closed
danicc097 opened this issue Jul 23, 2023 · 1 comment · Fixed by #1285
Closed

Wrong escaping when using merge #1238

danicc097 opened this issue Jul 23, 2023 · 1 comment · Fixed by #1285
Labels
bug Something isn't working openapi-ts Relevant to the openapi-typescript library

Comments

@danicc097
Copy link

Description

Wrong escaping when using merge:

x-error-response: &x-error-response
  4XX:
    description: Error response
    content:
      application/json:
        schema:
          $ref: '#/components/schemas/HTTPError'
paths:
  /admin/ping:
    get:
      summary: Ping pongs
      operationId: AdminPing
      responses:
        "200":
          description: OK
          content:
            text/plain:
              schema:
                type: string
                example: pong
        !!merge <<: *x-error-response
      tags:
        - admin
components:
  schemas:
    HTTPError:
      description: represents an error message response.
      type: object
      properties:
        title:
          type: string
        detail:
          type: string
        status:
          type: integer
        error:
          type: string

results in:

 Ping: {
    responses: {
      /** @description OK */
      200: {
        content: {
          "text/plain": string;
        };
      };
      /** @description Error response */
      "4XX": {
        content: {
          "application/json": external["external[%22components[%22schemas%22][%22HTTPError%22]%22]"]; 
        };
      };
    };
  };

Environment:

  • Ubuntu 20.04
  • openapi-typescript v6.2.4
  • Node v16.19.0
@danicc097 danicc097 added bug Something isn't working openapi-ts Relevant to the openapi-typescript library labels Jul 23, 2023
@drwpow drwpow mentioned this issue Aug 9, 2023
1 task
@drwpow
Copy link
Contributor

drwpow commented Aug 9, 2023

This was fixed in a recent release. I’ve added a test (#1285) to ensure no regressions happen in the future :)

@drwpow drwpow closed this as completed Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working openapi-ts Relevant to the openapi-typescript library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants