Git Product home page Git Product logo

Comments (4)

benyaminl avatar benyaminl commented on July 1, 2024 1

@vajahath I think it's clear enough, I will use swagger UI docker image. Thanks for clarifying.

from open-swagger-ui.

vajahath avatar vajahath commented on July 1, 2024

Please share more details. What command you tried to run? Where is your file located?

from open-swagger-ui.

benyaminl avatar benyaminl commented on July 1, 2024

@vajahath
same as on docs, open-swagger-ui ./swagger.json --open, but I have sub folder on that folder

[ben@TP-X220 api]$ pwd
/home/ben/Code/AcerAPI/api
[ben@TP-X220 api]$ tree
.
├── schemas
│   ├── common
# ...... output ommited for privacy reason.....
│   │   ├── ListMetadataResult.yaml
# ...... output ommited for privacy reason.....
│   ├── MarketPlace.yaml
│   ├── Notification.yaml
# ...... output ommited for privacy reason.....
└── swagger.yaml

2 directories, 81 files

It can't render the file scheme folder, only the swagger. based on the error, there should be basePath, and I already run the command on the basePath, probably It need for cli command to add basePath.

I think because the code https://github.com/vajahath/open-swagger-ui/blob/master/src/app.ts#L27 doesn't specify the basePath. scottie1984/swagger-ui-express#189 (comment)

I just guessing for now, as I haven't test it yet, because your Url is = '/swagger-doc', and based on the code, seems you only render the swagger.yaml. https://github.com/vajahath/open-swagger-ui/blob/master/src/app.ts#L24

from open-swagger-ui.

vajahath avatar vajahath commented on July 1, 2024

Could you please provide a sample swagger file with the issue you mentioned (after removing any sensitive data)?


Just FYI: This tool was never meant to be a bundler. If you have multiple fragments of swagger doc and you reference those files in a main swagger.yaml file, then open-swagger-ui may not be able to render it. It expects everything bundled in a single file. You can bundle all your fragments into a single file using the swagger-cli.

So you may add a bundling step to your workflow using the swagger-cli. Once the bundling is completed, open the output swagger file in open-swagger-ui.
Also, if you wanted to use basePath, you could add it directly to the swagger file: like https://github.com/vajahath/open-swagger-ui/blob/master/tests/swagger.yaml#L13.

from open-swagger-ui.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.