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 all 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.

Users can now directly convert the EDIFACT schema to the 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.

Overview of length constraints:

- 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