Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minOccurrences and maxOccurrences Handling in X12 to Ballerina Schema Conversion #51

Merged
merged 2 commits into from
Jul 5, 2024

Conversation

RDPerera
Copy link
Member

@RDPerera RDPerera commented Jul 5, 2024

Purpose

Fixes: ballerina-platform/ballerina-library#6658 , ballerina-platform/ballerina-library#6610

This PR addresses two issues in the EDI tool:

  1. Incorrect Handling of minOccurrences and maxOccurrences in Schema.json from X12 XSD Files:
    This fix resolves an issue where maxOccurrences/minOccurrences values from X12 XSD files were not accurately converted into schema.json, leading all values to default to 1 irrespective of the defined occurrences in the XSD.

This is a part of the sample X12 file;

Before Fix: Values of maxOccurrences and minOccurrences are not properly converted into Ballerina EDI schema.

After Fix: The same segment now correctly converts to schema.json with maxOccurrences and minOccurrences.

2. Enabling Documentation Comments in Generated Code:
Add documentation comments to the automatically generated public functions, enhancing the developer experience of the connector user.

Before Fix:

After Fix:

@RDPerera RDPerera requested a review from chathurace as a code owner July 5, 2024 05:02
@RDPerera RDPerera requested review from niveathika and aashikam July 5, 2024 05:40
edi-tools/modules/codegen/maincode_gen.bal Outdated Show resolved Hide resolved
edi-tools/modules/codegen/maincode_gen.bal Outdated Show resolved Hide resolved
edi-tools/modules/codegen/rest_connector_gen.bal Outdated Show resolved Hide resolved
edi-tools/modules/codegen/schema_code_gen.bal Outdated Show resolved Hide resolved
@RDPerera RDPerera requested a review from aashikam July 5, 2024 06:34
@gayaldassanayake
Copy link

Tested for X12 810, 850 examples, and works as expected.

@RDPerera RDPerera merged commit fc17f3d into ballerina-platform:main Jul 5, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MaxOccurances not correclty updated when generating schema.json from x12 xsd file using EDI tool
4 participants