In this video we will see how to use Swagger Codegen Maven Plugin to dynamically generate client stubs in spring boot project using a given swagger yaml or json file
https://github.com/swagger-api/swagge...
https://github.com/swagger-api/swagge...
Update
There is an issue in the fetch/all json generation
please use this to fix the same
its not deserialized when the response is List of Employees
we can fix it in two ways
1. from the previous swagger ui example - update the @APIResponse like below
@ApiResponse(code = 200, message = "SUCCESS", response = Employee.class, responseContainer = "List")
and generate the json file and use this json for codegen into resources folder
(or)
2. directly edit the .json file in the resource folder like below (ideally this gets generated from the above)
"summary": "Fetch All Employees",
"operationId": "fetchAllEmployeesUsingGET",
"produces": [
"*/*"
],
"responses": {
"200": {
"description": "SUCCESS",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Employee"
}
}
},
#swagger #springboot #codegen #swaggerui
На этой странице сайта вы можете посмотреть видео онлайн Spring Boot - with Swagger CodeGen Maven Plugin | Simple Programming длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Simple Programming 08 Июнь 2020, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 56,051 раз и оно понравилось 367 зрителям. Приятного просмотра!