简体   繁体   中英

Integrate the swagger ui into hammock

I am building up a CDI/REST Environment as basis for several projects by using hammock. What I would like to have besides CDI and REST is also json schema for generating payload classes and an automatically generated REST API documentation via swagger ui. I am now at the point where everything works (Weld3, Resteasy, Undertow, Swagger Core, Json Schema). The only thing missing is the integration of swagger UI into my hammock stack. In another project I already worked with swagger UI. As far as I know it is based on HTML + JS with an entry point index.hml. How do I integrate this into my hammock stack. How to tell the undertow that there is a index.html and where to find it ? I think my question is not only related to swagger, but to the idea to have the hammock stack with additional static html content.

John Ament has added a swagger module for Swagger 2.0-rc3 to Hammock 2.1-SNAPHOT (will be released as part of Hammock 2.1):

https://github.com/hammock-project/hammock/tree/master/swagger

As for hosting Swagger UI inside a Hammock app, you can add a few files from swagger-ui/dist/* to Hammock's static resources path:

https://github.com/hammock-project/hammock/wiki/Native-Filters#static-resources

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM