Now we have four openapi.yaml files and four openapi.json files available. Let’s use light-codegen
to start four projects in light-example-4j/rest/openapi/ms_aggregate. In normal API build, you
should create a repo for each API. For us, we have to user light-example-4j for all the
examples and tutorial for easy management in networknt github organization.
The project is cloned to the local already during the preparation stage. Let’s build it.
mvn clean install -DskipTests
Prepare Generator Config
Each generator in light-codegen requires several parameters to control how the generator
works. For more information on how to use generator, please refer to light-codegen.
For API AA, here is the config.json and a copy can be found in the folder
model-config/rest/openapi/aa/1.0.0 along with openapi.yaml and openapi.json.
As you can see the generated project will use 7441 for https and client module will be
included as it will call API AB, AC, AD with it. DB dependencies are not required for
Generate first project
Now you have your light-codegen built, let’s generate a project. Assume that
model-config, light-example-4j and light-codegen are in the same working
directory ~/networknt and you are in ~/networknt now.