incubator-kie-kogito-examples
incubator-kie-kogito-examples copied to clipboard
Controlling output from kogito-drools
I am able to run the dmn-quarkus-example and get the output from model. I am wondering how to customize the format of the output from the model.
For example, I want to remove the original inputs from the response. I also want to add a 'status' field in the returned JSON.
AFAIK there is no way to do this at the moment, but we could file a feature request. I think that when we will support custom definition of REST endpoints then you may just expose a custom POJO in your endpoint signature cc @tarilabs
cc @danielezonca
Since the Swagger/OAS generation is based on the specification conventions, this use-case can only be achieved by manual customisation of (other) REST endpoints by the developer. e.g.: skip REST generation, manually develop REST endpoint using Quarkus as desired.
I think there are way to approach the requirement:
- remove input from output: we have a similar option when DMN is used connected with Kafka (see option) and I think it could make sense to consider a similar option also for REST (@tarilabs wdyt?)
- customise the format via JsonMapper (it is already possible)
- customise the endpoint: for now it is only possible to disable all the REST using this property and then injecting the engine directly and write your own REST endpoint as you need