Skip to content

Conversation

@Fannon
Copy link

@Fannon Fannon commented Apr 29, 2025

Relates #4

This adds just the id keyword.

There will be another PR to also add the targettype keyword on property level.

Signed-off-by: Simon Heimler <simon.heimler@sap.com>
"TypeName": {
"name": "TypeName",
"type": "object",
"id": ["ID"],
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe more explicit:

Suggested change
"id": ["ID"],
"primaryid": ["ID"],

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"identity " should be clear.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"id": ["ID"],
"identity": ["ID"],

Copy link
Contributor

@clemensv clemensv left a 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}
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

objects and tuples.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Contributor

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"],
Copy link
Contributor

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.
Copy link
Contributor

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.

Copy link
Author

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `id` MUST only be used on objects.
Adding `identity` is optional, but only applicable on objects and tuples.

@clemensv clemensv added the companion spec candidate topic for a companion spec label Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

companion spec candidate topic for a companion spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants