2

Whole idea is to create Mock service for UI guys to test without actual api. - We have define specification in .ymcl files. - Now want to generate Swagger-UI and Mock rest URI with mock data. - Using spring-boot.

Please suggest some way to generate the same.

Ankit Singh
  • 21
  • 1
  • 3

2 Answers2

2

Given that you've the API documented in Swagger/OpenAPI spec (YAML format), you can use Swagger Codegen to generate Spring boot server stub.

Please pull the latest master of https://github.com/swagger-api/swagger-codegen and follow the instruction in the wiki:

https://github.com/swagger-api/swagger-codegen/wiki/Server-stub-generator-HOWTO#java-springboot

William Cheng
  • 10,137
  • 5
  • 54
  • 79
0

Generating code for stub server is not a great option. Instead you may want to look at the several API mocking tools that let you create a mock server based on your Swagger / OpenAPI specification.

Here is a relevant stackoverflow question and also suggest looking this list of API mock servers.

HariKrishnan
  • 456
  • 3
  • 14