swagger-ui icon indicating copy to clipboard operation
swagger-ui copied to clipboard

Path as reference with parameters are ignored

Open fabssor opened this issue 4 years ago • 2 comments

Q&A

  • OS: Windows 10 with WSL Ubuntu, also tried in Ubuntu as VM
  • Browser: Chrome/ Firefox/ Edge
  • Version: 88.0.4324.150/ 85.0.1 /85.0.564.67
  • Method of installation: docker-container
  • Swagger-UI version: 3.41.1,gitRevision: ge538e26
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

Example Swagger/OpenAPI definition: Main File:

...
  /users/{userId}:
    $ref: ./paths/Usermanagment/usersUserId.yaml
...

included File via ref

parameters:
  - in: path
    name: userId
    schema:
      $ref: './components/schemas.yaml#/userId'
    required: true
    description: Unique numeric ID of the user to get
    example: userid12
get:
  tags:
    - User Management
...

Swagger-UI configuration options: No options are used, just the plain container is started with

docker run -p 80:8080 -e SWAGGER_JSON=/tmp/swagger.yaml -v $(pwd):/tmp swaggerapi/swagger-ui

Describe the bug you're encountering

If a path object is referenced the common parameters of the path are not displayed in the swagger-ui.

To reproduce...

Steps to reproduce the behavior:

  1. create a main file.
  2. Reference a path object (see above), which has common parameters for the path
  3. See the error in the swagger-ui. The parameter is not shown...

Expected behavior

The parameter is shown.

Screenshots

image

Additional context or thoughts

  1. I also tested this with redoc. He shows the parameter correctly.
  2. Also if I resolve all references in the main file via a cli tool (speccy) and create one file the parameters are shown correctly again.

fabssor avatar Feb 11 '21 14:02 fabssor

any progress on this issue?

SuhwanJee avatar Jul 09 '24 06:07 SuhwanJee

I have the same issue whether the path ref exists in the same file or not. Any updates?

kopapageorgiou avatar Sep 27 '24 07:09 kopapageorgiou