bpmn-io / form-js

View and visually edit JSON-based forms.
https://bpmn.io/toolkit/form-js/
Other
390 stars 100 forks source link

Offer API to get the type of schema variables #556

Open marstamm opened 1 year ago

marstamm commented 1 year ago

Is your feature request related to a problem? Please describe.

We are working provideing variable suggestions to the user throughout the BPMN-Process. For this, we want to use linked form-js forms and extract the return variables.

Currently, we can use getSchemaVariables.

Also returning the type of the variable (e.g. Number/String/List/Boolean/...) would allow us to display this information in the variable suggestions. This helps users when the Context of the Form is no longer available during BPMN modeling.

Related to https://github.com/bpmn-io/form-js/issues/555, typed input variables would allow for more fine-grained linting, verifying that the variables are present and have the correct format.

Describe the solution you'd like


{ textField_1: "String", numberField_1: "Number" }



### Describe alternatives you've considered

- Don't show types for variables from forms
- Manually parse the schema

### Additional context

<!-- Add any other context or screenshots about the feature request here. -->
https://camunda.slack.com/archives/C043W5V88M7/p1677665447021069
https://github.com/bpmn-io/form-js/issues/555
Skaiir commented 1 year ago

This is not a very easy task, so I'll remove the spring cleaning label.

Skaiir commented 9 months ago

Worth noting that now that we have more complex nesting structures, we need to also account for it, making it a bit more complex.

https://github.com/bpmn-io/form-js/issues/913#issuecomment-1826469239