redocly-cli icon indicating copy to clipboard operation
redocly-cli copied to clipboard

"join" remove extension properties under path property

Open nginx-nickc opened this issue 8 months ago • 3 comments

Describe the bug

Extension x- properties under path properties are removed after "join".

To Reproduce Steps to reproduce the behavior:

  1. Given the included OpenAPI files(s), from join tests (foo.yaml, bar.yaml)
  2. Run this command with these arguments... npx @redocly/cli join ./bar.yaml ./foo.yaml -o test.yaml

Expected behavior

  • expects the x-foo: true to be under path /pets/{petId}.
openapi: 3.1.0
info:
  version: 1.0.0
  title: Bar Example OpenAPI 3 definition.
  description: Information about API
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://redocly.com/v1
tags:
  - name: bar_other
    x-displayName: other
  - name: foo_other
    x-displayName: other
paths:
  /pets/{petId}:
    post:
      summary: summary example
      operationId: exampleBar
      responses:
        '201':
          description: example description
      tags:
        - bar_other
  /pets:
    get:
      summary: Test summary
      operationId: exampleFoo
      parameters:
        - name: limit
          in: query
          description: How many items to return at one time (max 100)
          required: false
          schema:
            type: integer
            format: int
      responses:
        '200':
          description: example description
      tags:
        - foo_other
components: {}
x-tagGroups:
  - name: Bar Example OpenAPI 3 definition.
    tags:
      - bar_other
  - name: Foo Example OpenAPI 3 definition.
    tags:
      - foo_other

OpenAPI description

  • OpenAPI test spec from ./__tests__/join/references-in-parameters/ with x-foo: true added to /pets/{petId} path in bar.yaml

  • specs are 3.0

  • foo.yaml

openapi: 3.0.0
info:
  version: 1.0.0
  title: Foo Example OpenAPI 3 definition.
  description: Information about API
  license:
    name: MIT
    url: 'https://opensource.org/licenses/MIT'
servers:
  - url: 'https://redocly.com/v1'
paths:
  /pets:
    get:
      summary: Test summary
      operationId: exampleFoo
      parameters:
        - name: limit
          in: query
          description: How many items to return at one time (max 100)
          required: false
          schema:
            type: integer
            format: int
      responses:
        '200':
          description: example description
  • bar.yaml
openapi: 3.0.0
info:
  version: 1.0.0
  title: Bar Example OpenAPI 3 definition.
  description: Information about API
  license:
    name: MIT
    url: 'https://opensource.org/licenses/MIT'
servers:
  - url: 'https://redocly.com/v1'
paths:
  '/pets/{petId}':
    x-foo: true
    post:
      summary: summary example
      operationId: exampleBar
      responses:
        '201':
          description: example description

Redocly Version(s)

1.14.0

Node.js Version(s)

v21.7.0

nginx-nickc avatar May 29 '24 18:05 nginx-nickc