-
Notifications
You must be signed in to change notification settings - Fork 1
Add id keyword to objects to state primary IDs #7
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Simon Heimler <simon.heimler@sap.com>
| "TypeName": { | ||
| "name": "TypeName", | ||
| "type": "object", | ||
| "id": ["ID"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe more explicit:
| "id": ["ID"], | |
| "primaryid": ["ID"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"identity " should be clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "id": ["ID"], | |
| "identity": ["ID"], |
clemensv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Fannon Let me know whether you can still adapt this; otherwise I can take this one over.
| `$ref` is NOT permitted in other attributes and MUST NOT be used inside the | ||
| `type` of the root object. | ||
|
|
||
| ### `id` Keyword {#object-id-keyword} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"identity" will be clearer
|
|
||
| ### `id` Keyword {#object-id-keyword} | ||
|
|
||
| The `id` keyword is only applicable on objects and states the properties that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
objects and tuples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The `id` keyword is only applicable on objects and states the properties that | |
| The `id` keyword is only applicable on objects and tuples. It states the properties that |
| ### `id` Keyword {#object-id-keyword} | ||
|
|
||
| The `id` keyword is only applicable on objects and states the properties that | ||
| make up the primary ID(s) of the object. Providing more than one ID indicates |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lists the properties, in the role of identifiers, that establish an unambiguous identity of an instance. Providing more than one property reference indicates a composite identity, not a list of alternate identifiers.
| "TypeName": { | ||
| "name": "TypeName", | ||
| "type": "object", | ||
| "id": ["ID"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"identity " should be clear.
| } | ||
| ~~~ | ||
|
|
||
| The `id` MUST only be used on objects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identity SHOULD be used on object and tuple declarations. I assume the reason why you want to make it mandatory is the association feature, but I think that will just not work when there is no identity and that might be okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I only wanted to make the statement that they must only be used on objects, but there they would be optional.
I agree, they should be optional. Not every object may need an identity, e.g. value objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The `id` MUST only be used on objects. | |
| Adding `identity` is optional, but only applicable on objects and tuples. |
Relates #4
This adds just the
idkeyword.There will be another PR to also add the
targettypekeyword on property level.