Add id keyword to objects to state primary IDs#7
Add id keyword to objects to state primary IDs#7Fannon wants to merge 2 commits intojson-structure:mainfrom
Conversation
Signed-off-by: Simon Heimler <simon.heimler@sap.com>
| "TypeName": { | ||
| "name": "TypeName", | ||
| "type": "object", | ||
| "id": ["ID"], |
There was a problem hiding this comment.
Maybe more explicit:
| "id": ["ID"], | |
| "primaryid": ["ID"], |
There was a problem hiding this comment.
"identity " should be clear.
There was a problem hiding this comment.
| "id": ["ID"], | |
| "identity": ["ID"], |
| `$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.
"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.
| 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.
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.
"identity " should be clear.
| } | ||
| ~~~ | ||
|
|
||
| The `id` MUST only be used on objects. |
There was a problem hiding this comment.
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.
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.
| 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.