wso2 / mi-vscode

Micro Integrator extension for Visual Studio Code
Apache License 2.0
2 stars 3 forks source link

[DataMapper]Provide a way to make output data fields optional #382

Closed sameeragunarathne closed 1 month ago

sameeragunarathne commented 2 months ago

Description:

Currently, the loaded output root fields from a sample dataset are all being marked as required, which is not the intended behavior in all cases. Ideally, the data mapper UI should provide an option to mark all fields, or specific fields, as optional Or make all the fields optional and provide feature to mark required fields by the user. This is critical for healthcare use cases, where we are using FHIR resource samples to load the output data mapping structure.

Additionally, we were unable to provide a JSON schema due to a known issue [1].

[1] - https://github.com/wso2/mi-vscode/issues/118

Screenshot 2024-09-06 at 14 06 10

sample data file: patient_data.json

Describe your problem(s)

Describe your solution(s)

Related Issues (optional):

Suggested Labels (optional):

Improvement, Critical

Suggested Assignees (optional):

KCSAbeywickrama commented 2 months ago

The optional fields are correctly rendered, but they can only be specified through a JSON schema at this time. Since using schema option is not available here, as a temporary workaround, you can manually modify the interface definition in the source. We are working on this feature to allow fields to be optional at runtime through UI.

sameeragunarathne commented 1 month ago

The optional fields are correctly rendered, but they can only be specified through a JSON schema at this time. Since using schema option is not available here, as a temporary workaround, you can manually modify the interface definition in the source. We are working on this feature to allow fields to be optional at runtime through UI.

Thanks, but the manually editing is not a practical workaround since FHIR resources has many fields upto several nested levels. We can't confidently recommend the datamapper to do FHIR or healthcare related data mappings due to this. Therefore we are expecting a quick solution for this

KCSAbeywickrama commented 1 month ago

Add an option to set the optional/required state of an output field in MI Datamapper wso2-enterprise/vscode-extensions#3818

Added Make all child fields optional and Make all child fields required options to the existing context menu of an object/array in this https://github.com/wso2-enterprise/vscode-extensions/pull/3818 It adds flexibility to deal with inner objects/arrays. Not just dealing with the root output.

ChinthakaJ98 commented 1 month ago

The latest release v1.1.1 has resolved this issue. Please reopen if the problem persists.