Skip to content

describe how validation errors are returned from the batch api - #599

Merged
technoweenie merged 3 commits into
masterfrom
batch-api-validation-spec
Sep 2, 2015
Merged

technoweenie merged 3 commits into
masterfrom
batch-api-validation-spec

Conversation

@technoweenie

Copy link
Copy Markdown
Contributor

Updates the batch API spec to match #597.

Comment thread docs/api/http-v1-batch.md Outdated

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.

Sorry, previous comment based on diff but didn't apply once I'd expanded it (talking about download not upload). Should this paragraph specifically identify that this applies to the 'download' case?

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.

Also, a similar response can happen for upload but for different reasons, i.e. if the object already exists.

Maybe this should be in a separate section headed '200 partial responses' and give examples for valid cases for download & upload.

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.

I like the idea of splitting out a separate section for 200 partial responses. 👍

IMO, a request to upload an existing file is not an error. The object should have no error and no actions set on it. The lack of an upload action means the client can skip it.

I think in previous API versions, the server returned a download action on existing objects instead. I don't think the client even bothers to check this though.

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.

IMO, a request to upload an existing file is not an error. The object should have no error and no actions set on it. The lack of an upload action means the client can skip it.

100% agree, when I said 'a similar response' I meant a missing upload entry for the object in the response, sorry for the ambiguity.

I think in previous API versions, the server returned a download action on existing objects instead. I don't think the client even bothers to check this though.

Yeah, and I've mirrored that in test servers I've built too :) But that's because the old API didn't have an intended operation; leaving the object out seems more consistent.

@technoweenie

Copy link
Copy Markdown
Contributor Author

Rewrote how we present the responses in the spec. It now shows the various possible responses: successful, partial error, validation error, 403, 401, etc. I also added a new header for 401 responses: LFS-Authenticate. This is an attempt to be forward compatible with NTLM auth (#617).

@rubyist

rubyist commented Sep 1, 2015

Copy link
Copy Markdown
Contributor

👍

Comment thread docs/api/http-v1-batch.md Outdated

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.

Should this be "Servers can also set an upper bound"? I don't think an upper bound would be commonplace for self-hosting, only when you're providing hosting for other people.

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.

I was purposely trying to use one of the rfc conformance words. Though after looking at the RFC for the RFC conformance words, I think you're right:

SHOULD This word, or the adjective "RECOMMENDED", mean that there
may exist valid reasons in particular circumstances to ignore a
particular item, but the full implications must be understood and
carefully weighed before choosing a different course.

MAY This word, or the adjective "OPTIONAL", mean that an item is
truly optional. One vendor may choose to include the item because a
particular marketplace requires it or because the vendor feels that
it enhances the product while another vendor may omit the same item.
An implementation which does not include a particular option MUST be
prepared to interoperate with another implementation which does
include the option, though perhaps with reduced functionality. In the
same vein an implementation which does include a particular option
MUST be prepared to interoperate with another implementation which
does not include the option (except, of course, for the feature the
option provides.)

@sinbad

sinbad commented Sep 2, 2015

Copy link
Copy Markdown
Contributor

Looks good, just one tiny comment on the docs.

technoweenie added a commit that referenced this pull request Sep 2, 2015
describe how validation errors are returned from the batch api
@technoweenie
technoweenie merged commit 72c5222 into master Sep 2, 2015
@technoweenie
technoweenie deleted the batch-api-validation-spec branch September 2, 2015 16:36
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.

3 participants