The config.json
configuration
DRAPI is driven by a dynamic configuration. In order to get your extension recognized you must provide the information what verticle will run your code and what classes implement your business logic. To do so a file resources/config/config.json
is required:
{
"versions": {
"eoffice": {
"path": "/schema/openapi.eoffice.json",
"active": true
}
},
"verticles": {
"MyOffice": {
"worker": false,
"className": "com.hcl.domino.keep.verticles.DominoDefaultVerticle",
"tags": {
"approval": "io.projectkeep.domino.keep.dbrequests.approval"
},
"active": true
},
"RestAPI": {
"versions": {
"eoffice": {
"package": "io.projectkeep.domino.keep.handlers",
"route": "/api/eoffice-v1",
"defaultClass": "com.hcl.domino.keep.handlers.core.DefaultJsonHandler",
"defaultDatabase": "names"
}
}
}
}
}
Explanation
- versions contains all active API collections
- The name must match the middle part of your OpenAPI file (
openapi.eoffice.json
) - The entries in the verticle key determine how the HTTP side (fixed name
RestAPI
) and the database side (choose your own name) process your API - Specifies the verticle to use on database side. The default entry works for all regular API calls
- The tags entry is used to determine the package name for your implementation class (see below)
- This must match (2) and the middle part of your OpenAPI file name
- The package name for eventual HTTP side handlers, not relevant as long as you deal with JSON in/out
- The route needs to match your OpenAPI file and is the actual route used. If mismatched, interactive Swagger won't work.
- Leave the default entries as is. Advanced use cases are not subject of this tutorial
Determine the class names for the business logic
The class name gets derived from the tag and the OperationID specified in the OpenAPI file. The tag gets mapped to a Java package name, while the OperationID forms the class name after the first letter gets captallized
Let's connect
We really like to hear from you!
Your opinion matters. Let us know all your:
- questions
- discussions
- ideas
- feedback
Join the OpenNTF Discord channel.