Hello fellow Kogito-ians,
I'm working hard to somehow extract DMN Data Types (and most importantly and additionally the type Constraints) information so that our DMN client services (backend services calling the REST endpoints) can utilize the extracted types as a mean to validate content before calling the downstream models and even to represent those extracted schemas through a UI.
The generated OpenAPI spec is really a great addition, as well as the generated `target/classes/META-INF/resources/dmnDefinitions.json` files (json-schema?).
The issue here is the constraints of the data types - it appears that string types, with added Enum constraint, are reflected correctly in the generated json schema, for example, this is generated from a string data type with enum constraint of 2 strings ("amit" & "keren"):
"first_name": {
"enum": [
"amit",
"keren"
],
"type": "string",
"x-dmn-type": "DMNType{ https://kiegroup.org/dmn/_C334EEAE-08D0-419A-98A2-5AF5BF3D649C : first_name }"
}
whereas, for a field named "some_number", of type: number, with type constraint of "range", as annotated in the DMN xml as:
<dmn:itemDefinition id="_87A220EA-37CF-42AB-A7AF-FBA631CD59D6" name="some_number" isCollection="false">
<dmn:typeRef>number</dmn:typeRef>
<dmn:allowedValues kie:constraintType="range" id="_41CBF70A-18BE-4871-B423-236ED8AC57E4">
<dmn:text>[1..5]</dmn:text>
</dmn:allowedValues>
</dmn:itemDefinition>
is not reflected in the generated json schema:
I'm not sure if this is the intended behavior and if so is there another mechanism that I could use to "extract" the allowed value ranges for a given input data-type?
Many thanks for the great great work!