This is a tool to generate validators, structures and web servers based on OpenAPI and ILEastic/noxDB. It depends on ILEastic & noxDB to be installed in order to use the web server and JSON APIs.
- Because OpenAPI is awesome
- Spend less time maintaining and coding your API
- Spend more time building your APIs using OpenAPI (checkout Stoplight, it is free!)
- Quickly get started building complex APIs using RPGLE
- Generates all code for the web server, validation and structures for all JSON schemas!
- Install ILEastic & noxDB
- Clone this repo &
npm i
- Paste your spec into a file called
openapi.yaml
- Use
node index
to generate code (see below).
This tool will generate a few files in the output
directory based on your spec:
webapp.rpgle
- the base of the application, which will include the router and procedures to host the APIs. These are example routers that can be changed to suit your needs. The router functions call the validation functions.validation.rpgle
- includes functions for each API (and eventually each model) to validate the headers, query parameters and JSON body if they are applicable. This code is easily re-usable and can easily be brought into existing APIs, even if you don't use the source generated for the base file.structs.rpgle
- structure templates that match your JSON input, output and modelsintoStructs.rpgle
- generated procedures to take the noxDB JSON structures and store the data into the generated structures (fromstructs.rpgle
)outofStructs.rpgle
- generated procedures to take the generated structs (fromstructs.rpgle
) and turn them into noxDB JSON stores.