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

Add EDI Tool changes #8938

Merged
merged 8 commits into from
Apr 29, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,38 @@ $= future<int> result = start name();

#### CLI

#### EDI tool

- Added support for EDIFACT to Ballerina schema conversion.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be headings since we have lengthy explanations after?

Copy link
Member Author

@RDPerera RDPerera Apr 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thats the correct way. I changed it with 14889b3. but seems like It doesn't align with other tool notes, isn't it? What should we do?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, looks like the OpenAPI changes are in point form, right? Shall we change back to that for consistency then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done with e1e1d19.


Users can now directly convert EDIFACT schema to Ballerina schema by specifying the EDIFACT version, message type, and output directory using the new tooling support.

For example,

`bal edi convertEdifactSchema -v <EDIFACT version> -t <EDIFACT message type> -o <output folder>`

- Introduced support for field length constraints (min/max)

This update introduces minimum and maximum length constraints for EDI data fields, enhancing validation capabilities and ensuring data compliance.

Length Constraints Overview:
RDPerera marked this conversation as resolved.
Show resolved Hide resolved

- Fixed-Length: Fields must match the specified length `N`. If not, Ballerina will either pad the field with spaces or produce an error if the field exceeds `N`.
- Range Limits:
- Minimum Length: If a field is shorter than specified, an error is triggered.
- Maximum Length: Fields longer than allowed will also trigger an error.

For example,

```json
"fields": [
{"tag": "DocumentNameCode", "length": 10},
{"tag": "DocumentNumber", "length": {"min": 1}},
{"tag": "MessageFunction", "length": {"max": 3}},
{"tag": "ResponseType", "length": {"min": 1, "max": 3}}
]
```

#### OpenAPI tool

- Integrated OpenAPI client generation to the `bal build` command.
Expand Down Expand Up @@ -686,6 +718,10 @@ $= future<int> result = start name();
>**Info:** The migration support is an experimental feature and currently only supports MySQL databases. The commands associated with the feature might change in future releases.

### Improvements
#### EDI tool
RDPerera marked this conversation as resolved.
Show resolved Hide resolved

- Added support for EDIFACT to Ballerina schema conversion.
- Introduced support for field length constraints (min/max), enhancing validation capabilities for EDI data fields.

#### OpenAPI Tool

Expand Down