Legion2 / swagger-ui-action

Generate Swagger UI in a GitHub Actions workflow
MIT License
44 stars 6 forks source link

Needs to copy yaml files manually if openapi.yaml is not placed at the repository root #483

Open watanabe-pfr opened 1 month ago

watanabe-pfr commented 1 month ago

Thank you for providing a great tool.

Please support the relative path based on the position of openapi.yaml .

If the openapi.yaml is not placed at the repository root, like below, the deployed pages cannot access to the parts directory with relative path.

.
├── interface
│   ├── README.md
│   └── v1
│       ├── openapi.yaml
│       └── parts
│           ├── part1.yaml
│           ├── part2.yaml
│           └── part3.yaml
└── README.md

It can be resolved with manual copy:

- name: Copy OpenAPI files
        run: |
          mkdir -p swagger-ui/parts
          cp interface/v1/openapi.yaml swagger-ui/
          cp interface/v1/parts/*.yaml swagger-ui/parts/

It'll be more intuitive if the build output is generated based on the path of openapi.yaml Thank you.

Legion2 commented 1 month ago

I think the problem here is that currently only the openapi.yaml file is copied automatically. Other files must be manually copied to the correct place in the generated swagger ui output.