This is a project containing an OpenAPI specification according to which API classes are automatically generated during each compilation to help you create your own Rest service simpler. It demonstrates Contract First approach.
Check Gradle is installed and configured.
Clone the source locally:
$ git clone https://github.com/MorkovkAs/openapi-example-toys-autogen/
Build and run project:
$ cd openapi-example-toys-autogen/
$ ./gradlew build bootRun
Go to localhost page to see Swagger UI with Toys shop OpenAPI specification. Methods createToy, getToyById and deleteToyById have custom realizations. Others haven't. So http code 501 (NOT_IMPLEMENTED) will return.
OpenAPI specification is located here.
Generated classes by OpenAPI specification will be located after compilation in build/generated/openapi/src
.
To use generated code you should create your custom controller which implements a generated one. See ToysController class.
Any questions or problems give me a shout on email avklimakov@gmail.com
Copyright 2023 Anton Klimakov
Licensed under the Apache License, Version 2.0