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

null auto test cases now return 204 rather than JSON #44

Merged
merged 4 commits into from
Sep 3, 2018
Merged

Conversation

dansanduleac
Copy link
Contributor

@dansanduleac dansanduleac commented Aug 31, 2018

Before this PR

Auto-deserialize tests would always send the literal JSON value in the test to the client.

Afer this PR

If the value is null, then we respond with a 204 instead.

Added an receiveRawOptionalExample endpoint that returns an alias to a optional<integer> to exercise this:

curl -si http://127.0.0.1:8000/receiveRawOptionalExample/0
HTTP/1.1 204 No Content
access-control-allow-origin: *
content-length: 0
date: Fri, 31 Aug 2018 17:02:26 GMT

and sending it back as null is accepted:

curl -si http://127.0.0.1:8000/confirm/receiveRawOptionalExample/0 -H 'content-type: application/json' -d 'null'
HTTP/1.1 204 No Content
access-control-allow-origin: *
content-length: 0
date: Fri, 31 Aug 2018 17:04:41 GMT

Fixes #38

@dansanduleac dansanduleac requested a review from a team as a code owner August 31, 2018 16:49
@qinfchen
Copy link
Contributor

@iamdanfox, as per your comment in palantir/conjure-python#16, do we need to handle map, set, and list? Note that the spec.md only recommends 204 for empty containers, and 200 is fine as well.

Copy link
Contributor

@ferozco ferozco left a comment

Choose a reason for hiding this comment

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

Looks good to me! Keen to see how this impacts our implementations

@ferozco ferozco merged commit 2c91d06 into develop Sep 3, 2018
@ferozco ferozco deleted the ds/204 branch September 3, 2018 10:10
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