Skip to content

Add support for Json Batch Requests in Odata Client - #1749

Merged
KenitoInc merged 1 commit into
OData:masterfrom
KenitoInc:feature/json-batch-requests
May 20, 2020
Merged

KenitoInc merged 1 commit into
OData:masterfrom
KenitoInc:feature/json-batch-requests

Conversation

@KenitoInc

@KenitoInc KenitoInc commented Apr 21, 2020 •

Copy link
Copy Markdown
Contributor

Description

Currently Odata Client only supports multipart/mixed batch requests while ODL has support for both json batch requests and multipart/mixed batch requests. We are adding support for OData Json Batch Requests in OData Client.

We are adding a new SaveChangesOption flag named UseJsonBatch. When you add the flag in batch requests when calling SaveChangesAsync, the request and response will have Content-Type as application/json

Checklist (Uncheck if it is not completed)

  • Test cases added
  • Build and test with one-click build and test script passed

Additional work necessary

If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.

@KenitoInc
KenitoInc marked this pull request as ready for review April 24, 2020 11:51
@KenitoInc
KenitoInc force-pushed the feature/json-batch-requests branch from 41168a3 to 9611731 Compare April 24, 2020 12:00
@odero odero added the Ready for review Use this label if a pull request is ready to be reviewed label May 6, 2020
@odero odero added this to the 7.7.0 milestone May 6, 2020

@mikepizzo mikepizzo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:shipit:

if (!this.useJsonBatch)
{
Error.ThrowBatchExpectedResponse(InternalError.UnexpectedBatchState);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Really? This seems like a bug in the ODataJsonLightBatchReader -- your state shouldn't depend on the format.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@mikepizzo Definitely a bug in ODataJsonLightBatchReader

@mikepizzo mikepizzo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🕐

@mikepizzo mikepizzo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:shipit:

Comment thread src/Microsoft.OData.Client/BatchSaveResult.cs Outdated
Comment thread src/Microsoft.OData.Client/DataServiceClientFormat.cs Outdated
Comment thread src/Microsoft.OData.Client/DataServiceClientFormat.cs Outdated
@KenitoInc
KenitoInc force-pushed the feature/json-batch-requests branch from b430901 to a8642a4 Compare May 11, 2020 11:21
Comment thread src/Microsoft.OData.Client/BatchSaveResult.cs
Comment thread src/Microsoft.OData.Client/BatchSaveResult.cs

@paulodero paulodero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:shipit:

@gathogojr gathogojr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@KenitoInc Left one comment, otherwise LGTM

@KenitoInc
KenitoInc force-pushed the feature/json-batch-requests branch from 999e6b9 to ff754ff Compare May 19, 2020 10:12

@odero odero left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"dependsOn" is a key functionality of json batch which afaik multipart doesnt support.
Next step I'd recommend you add support for this

@KenitoInc
KenitoInc merged commit 20100aa into OData:master May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready for review Use this label if a pull request is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants