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

Change related entity with PUT #1994

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Change related entity with PUT #1994

wants to merge 15 commits into from

Conversation

HeikoTheissen
Copy link
Contributor

Fixes #1973

Example ##ex: When updating an entity with a 4.01 `PUT` request, the target of a
non-containment navigation property can be replaced without changing either the
old or the new targeted entity itself. The targeted entity can then only be
specified by an entity reference (see [OData-JSON, section "Entity Reference"]($$$OData-JSON$$$#EntityReference)):
Copy link
Contributor

Choose a reason for hiding this comment

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

"specified as"?

ralfhandl
ralfhandl previously approved these changes Sep 12, 2024
Comment on lines 579 to 581
"@context": "$metadata#$ref",
"@id": "Employees(6)",
"EmployeeID": 6
Copy link
Contributor

Choose a reason for hiding this comment

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

That is not a valid entity reference, additional properties are not allowed.

Copy link
Contributor

Choose a reason for hiding this comment

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

If you remove the @context, it becomes an incomplete entity and a valid example for undesired effects.

ralfhandl
ralfhandl previously approved these changes Sep 12, 2024
@ralfhandl
Copy link
Contributor

Suggestion from @GEricson: use two-column table, with request on the left and resulting entities in the right column.

ralfhandl
ralfhandl previously approved these changes Sep 26, 2024
ralfhandl
ralfhandl previously approved these changes Sep 26, 2024
@ralfhandl
Copy link
Contributor

@HeikoTheissen

  • add headings to requests and responses
  • explicitly mention sloppy references without context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to change a reference without changing the referenced entity in a PUT request
2 participants