Hi Ron, I want to use swagger-ui to generate html documentation which can be hosted online for our consumers to read.
Could you please eloborate how can i use swagger-ui tool to generate html pages using my swagger.json files. Thanks On Saturday, October 10, 2015 at 4:59:39 AM UTC+5:30, Ron wrote: > > Aha, now it's clearer, thanks. > > So swagger-ui is not a statically generated html set but rather a static > set of html pages that dynamically load a swagger definition and renders > it. This is very different from the codegen that indeed reads the > swagger.json and just pours it all into an html file without having any of > the swagger.json info left in it. > > So if you want to use swagger-ui itself, you'd have to use a slightly > different approach. If you need assistance with how to use swagger-ui, let > me know. > > On Mon, Sep 28, 2015 at 1:53 PM, Anoop <[email protected] <javascript:>> > wrote: > >> Hi Ron, >> >> Sorry if I was unclear with my previous question. >> >> Currently I have generated a static html page using the swagger codegen >> as you have mentioned earlier (which does not have the "try it out" >> feature/button). >> I manually generated the swagger.json using the swagger editor online and >> used the following command to generate the static html page >> >> java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar >> generate -i ~/Downloads/swagger.json -l html -o samples/ >> >> Since I am not familiar with html, css, javascript etc. I wanted to know >> if there is a way to generate the swagger UI (like petstore UI) by using my >> own swagger.json (meaning is there a cli or command that I can feed my >> swagger.json and get the UI) >> If so, how would I do that, could you please elaborate if possible. >> >> Appreciate your help >> >> On Monday, September 28, 2015 at 12:10:28 PM UTC-7, Ron wrote: >>> >>> Not sure I follow your question. How would you feed the JSON to it if >>> not by modifying the index.html? You can pass the url parameter to it, but >>> that would be to a hosted json. Otherwise, you'll have to edit the >>> index.html. >>> >>> On Mon, Sep 28, 2015 at 1:41 PM, Anoop Rajanna <[email protected]> >>> wrote: >>> >>>> Hi Emily/Ron >>>> >>>> Could either of you please answer the thread's last question, I have >>>> the same question. >>>> Pasting it again. >>>> >>>> Is there a way to get swagger-ui to generate an index.html based on a >>>> JSON file? >>>> In other words, can I feed my Swagger documentation (the swagger.json >>>> file) into swagger-ui and have it generate a UI based on my JSON? So that >>>> when I opened index.html, it would look like my API instead of the >>>> petstore. >>>> Or are you saying that I would need to manually edit the index.html >>>> file to achieve this? >>>> >>>> Thanks a ton, >>>> Anoop >>>> >>>> >>>> On Wednesday, October 15, 2014 at 5:25:02 PM UTC-7, [email protected] >>>> wrote: >>>>> >>>>> Never mind, someone here has helped me get it going. Thanks for your >>>>> help in any case, appreciate it. Best Regards, >>>>> >>>>> Emily >>>>> >>>>> >>>>> On Wednesday, October 15, 2014 1:14:36 PM UTC-7, [email protected] >>>>> wrote: >>>>>> >>>>>> Hi Ron, >>>>>> >>>>>> OK thanks. Is there a way to get swagger-ui to generate an index.html >>>>>> based on a JSON file? In other words, can I feed my Swagger >>>>>> documentation >>>>>> (the swagger.json file) into swagger-ui and have it generate a UI based >>>>>> on >>>>>> my JSON? So that when I opened index.html (or whatever file), it would >>>>>> look >>>>>> like my API instead of the petstore. >>>>>> >>>>>> Or are you saying that I would need to manually edit the index.html >>>>>> file to achieve this? >>>>>> >>>>>> Thanks so much for your help and this additional information about >>>>>> the CORS stuff. It sounds like if I fork the swagger-ui into the github >>>>>> repo that generates my GitHub pages, it will not have a CORS issue. >>>>>> That's >>>>>> good news, thanks! >>>>>> >>>>>> Emily >>>>>> >>>>>> >>>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Swagger" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> >>> >>> -- >>> ----------------------------------------- >>> http://swagger.io >>> https://twitter.com/SwaggerApi >>> ----------------------------------------- >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Swagger" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > ----------------------------------------- > http://swagger.io > https://twitter.com/SwaggerApi > ----------------------------------------- > -- You received this message because you are subscribed to the Google Groups "Swagger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
