Swagger分三個部分,Swagger editor、Swagger UI、Swagger Codegen。Swagger editor去定義api specification,Swagger UI把Swagger editor定義的api變成網站,方便寫程式的人看,Swagger codegen是將這些api definition變成code,讓我們之後去implement business logic。
Building APIs with Swagger and the OpenAPI Specificationarrow-up-right
Spring: Spring Cloud - Document microservices with Swaggerarrow-up-right
AWS API Gateway with HTTP, Lambda, DynamoDB, and iOSarrow-up-right - Generate an SDK with Swagger
Swagger基本內容先看 [1],[1] 很詳細說明Swagger UI,但沒有code generation的內容。
如果想要將swagger UI deploy到spring boot看 [2]。
Swagger code generation請看 [3],但 [3] 講的東西其實很少。其實用Maven將generated file產出之後,之後去implement即可,也不太需要學什麼。
避免部署Swagger UI的方式就是copy你的yaml file,past到swagger editor即可。
https://editor.swagger.io/arrow-up-right
REST
YAMLarrow-up-right
JSON
https://github.com/OAIarrow-up-right
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#schemaarrow-up-right
Last updated 5 years ago