-
Notifications
You must be signed in to change notification settings - Fork 39
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
Is RelationshipType defined properly in CALM? #826
Comments
Option 2 certainly seems cleaner if it's valid. |
I think this is a good example of #818 I agree with @LeighFinegold and @rocketstack-matt that option 2 is better, but it does loosen the JSON Schema validation of a relationship. This might not be an issue, if we agree that our JSON schema isn't perfect but pragmatic. Current Implementation: Enforces a stricter validation logic since the relationship-type must be an object with defined properties and exactly one property from the oneOf list. Proposed Implementation: Looser validation since relationship-type can directly resolve to one of the four $ref types without enforcing additional structure. Summary:
|
Just to add some support for option 2 as well, I actually already modeled it this way in the manual TypeScript types that I wrote for CALM a while back https://github.com/finos/architecture-as-code/blob/main/shared/src/types.ts#L19 I think having the weaker JSON Schema validation is a worthwhile trade off. |
I'd missed the subtlety . . . but is it looser or just different? Isn't the difference that in Option 2 it simply can't have additional properties, but is still strict in the sense that it must be one of the declared relationship types? |
Support Question
For a lot of tooling e.g. visualiser, generator we are defining a model to work with.
Whilst experimenting with json schema to pojo generator as an additional replacement for the java generator module (#702) , a question arose around the relationship type modelling
Option 1
represented by this json schema definition
Even if we keep with this option, in all json schema examples, I don't think the property section should exist
Option 2
which is represented
This seems more inline with Device Type example on https://json-schema.org/learn/json-schema-examples
The text was updated successfully, but these errors were encountered: