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

feat: Disable refs in the generated Yaml file #2696

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

devoto13
Copy link
Contributor

@devoto13 devoto13 commented Nov 8, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

I don't think tests or docs changes are needed, but let me know if you disagree.

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

The generated Yaml specification includes content refs at seemingly arbitrary places. While this is a perfectly valid Yaml, some of the tools may not be able to deal with this (e.g. Redocly preview in the WebStorm) and it makes the file harder to read or diff because one does not control where references are used in the generated specification.

Issue Number: N/A

What is the new behavior?

The library is configured to not use content refs in the generated Yaml specification.

Example:

  /resources:
    post:
      operationId: create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseDto'
-      tags: &ref_0
+      tags:
        - MyTag
-      security: &ref_1
+      security:
        - ServiceKey: []
  /resources/{id}:
    put:
      operationId: update
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '204':
          description: ''
-      tags: *ref_0
-      security: *ref_1
+      tags:
+        - MyTag
+      security:
+        - ServiceKey: []

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@kamilmysliwiec kamilmysliwiec merged commit cf4f7bc into nestjs:master Nov 8, 2023
1 check passed
@kamilmysliwiec
Copy link
Member

lgtm

@devoto13 devoto13 deleted the no-refs branch November 10, 2023 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants