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

Cannot write a nested delta payload to a top-level resource #2252

Closed
mikepizzo opened this issue Nov 17, 2021 · 0 comments · Fixed by #2250
Closed

Cannot write a nested delta payload to a top-level resource #2252

mikepizzo opened this issue Nov 17, 2021 · 0 comments · Fixed by #2250
Assignees

Comments

@mikepizzo
Copy link
Member

A valid response to PATCH against a single resource with a collection is a response containing a nested delta resource set. However, ODL doesn't allow you to write a top-level resource with a nested DeltaResourceSet.

Assemblies affected

OData.Net 7.x

Reproduce steps

  1. Create a resource writer
  2. Call WriteStart(resource)
  3. Call WriteStart(nestedResourceInfo)
  4. Call WriteStart(deltaResourceSet)

Expected result

Successfully write the resource with the nested resource set as an nested delta collection.

Actual result

An error, since you can't write a delta resource set if you start with a resource writer.

Additional detail

Today that is not possible because you can only write a delta response if you declare in your top-level resource set writer that you are writing a delta payload.

There is no longer any reason to declare up-front whether a writer is writing a delta request/response versus a non-delta request/response. A user should be able to call WriteStartDeltaResourceSet and write a delta resource set at the top level or nested within a resource.

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

Successfully merging a pull request may close this issue.

1 participant