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

Generating schema for relationship class #56

Open
Fak3 opened this issue Dec 4, 2019 · 4 comments
Open

Generating schema for relationship class #56

Fak3 opened this issue Dec 4, 2019 · 4 comments
Assignees
Labels
on-hold Task is on hold for now

Comments

@Fak3
Copy link

Fak3 commented Dec 4, 2019

We discussed json serialization rules with @onthebreeze, decided to go forward with solution proposed at edi3/edi3-uml-profile#8.
So below are the new rules for handling qualified relationships (relationship class):

Simple relation case
When in the model the relationship class only contains single property (qualifier) which has limited set of allowed values (i.e. typed as enumeration), then for all possible values of that property (qualifier) in the model (values from the enumeration), the JSON schema of the source class should have the corresponding property (json key) with the name equal to that value. Each such property should have a schema generated in the same way as if it represented an unqualified relationship from source to the target entity, i.e. have type: array and that array items should have type:object and that object should include all identifying properties of the target class. So in the example above, if MovementPartyRole_Code could have values of operator or owner, the schema for TransportMovement should include two array properties, correspondingly named operator and owner. Items of that array should be objects, and have a $ref to the schema, called TransportMovementParty. TransportMovementParty schema should declare two properties - Identification and Name (from Party class).

Complex relation case
{TODO} - I will create another ticket

@onthebreeze
Copy link
Contributor

Actually I wonder whether we should just drop the use of relationship class and instead just enumerate each value as a separate relationship in the uml too. Actually the source model from UN is like that already - abd we convert to relationship class when generating the model

@faizanvahevaria
Copy link
Contributor

@onthebreeze & @Fak3
Is there any instruction to follow and update for me ?

@faizanvahevaria faizanvahevaria self-assigned this Dec 16, 2019
@faizanvahevaria
Copy link
Contributor

@onthebreeze & @Fak3
Is there any instruction to follow and update for me ?

@Fak3
Copy link
Author

Fak3 commented Jan 2, 2020

We have not come to the decision yet, put it on hold for now

@faizanvahevaria faizanvahevaria added the on-hold Task is on hold for now label Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on-hold Task is on hold for now
Projects
None yet
Development

No branches or pull requests

3 participants