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

docs: fix projection curl commands (#1298) #1312

Conversation

pedro2555
Copy link
Contributor

Descrition

curl commands for the projection feature docs are incorrect, this merge request updates them.

Closes #1298

Output

The output of both commands on the public demo api.

$ curl -i -G http://eve-demo.herokuapp.com/people --data-urlencode 'projection={"lastname": 1, "born": 1}'
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 2364
X-Total-Count: 7
Cache-Control: max-age=20
Expires: Mon, 16 Sep 2019 14:33:23 GMT
Last-Modified: Fri, 13 Sep 2019 08:34:26 GMT
Server: Eve/0.8 Werkzeug/0.14.1 Python/3.6.5
Date: Mon, 16 Sep 2019 14:33:03 GMT
X-Cache: MISS from w4m-mmm-almada-1
X-Cache-Lookup: HIT from w4m-mmm-almada-1:0
Via: 1.1 vegur, 1.1 w4m-mmm-almada-1 (squid/3.5.12)
Connection: keep-alive

{"_items": [{"_id": "5d70994dec8f9500043e5fe3", "lastname": "Red", "born": "Sun, 20 Jul 1980 11:00:00 GMT", "_updated": "Thu, 05 Sep 2019 05:12:45 GMT", "_created": "Thu, 05 Sep 2019 05:12:45 GMT", "_etag": "4cf5236b47951a074d9d526ba216bb6cfc57bc32", "_links": {"self": {"title": "person", "href": "people/5d70994dec8f9500043e5fe3"}}}, {"_id": "5d70994dec8f9500043e5fe4", "lastname": "White", "born": "Fri, 25 Sep 1970 10:00:00 GMT", "_updated": "Thu, 05 Sep 2019 05:12:45 GMT", "_created": "Thu, 05 Sep 2019 05:12:45 GMT", "_etag": "9050d049a2d90c13f33516f47baae53d6c9f77be", "_links": {"self": {"title": "person", "href": "people/5d70994dec8f9500043e5fe4"}}}, {"_id": "5d7b5492fa78500004da6e92", "lastname": "clinton", "_updated": "Fri, 13 Sep 2019 08:34:26 GMT", "_created": "Fri, 13 Sep 2019 08:34:26 GMT", "_etag": "cbac8162f6843a450c6e9eefc378ba6a03594069", "_links": {"self": {"title": "person", "href": "people/5d7b5492fa78500004da6e92"}}}, {"_id": "5d7b5492fa78500004da6e93", "lastname": "romney", "_updated": "Fri, 13 Sep 2019 08:34:26 GMT", "_created": "Fri, 13 Sep 2019 08:34:26 GMT", "_etag": "f1c2baba8f0eec777384547d9113643117287c07", "_links": {"self": {"title": "person", "href": "people/5d7b5492fa78500004da6e93"}}}, {"_id": "5d70994dec8f9500043e5fe0", "lastname": "Doe", "born": "Thu, 27 Aug 1970 14:37:13 GMT", "_updated": "Thu, 05 Sep 2019 05:12:45 GMT", "_created": "Thu, 05 Sep 2019 05:12:45 GMT", "_etag": "dc5c0ba4282ce1406235f4bfb198e7f8c4b5a433", "_links": {"self": {"title": "person", "href": "people/5d70994dec8f9500043e5fe0"}}}, {"_id": "5d70994dec8f9500043e5fe1", "lastname": "Love", "born": "Wed, 25 Feb 1987 17:00:00 GMT", "_updated": "Thu, 05 Sep 2019 05:12:45 GMT", "_created": "Thu, 05 Sep 2019 05:12:45 GMT", "_etag": "8d7bcd0d69af16c499d6bcf7542efcc7f654aab8", "_links": {"self": {"title": "person", "href": "people/5d70994dec8f9500043e5fe1"}}}, {"_id": "5d70994dec8f9500043e5fe2", "lastname": "Green", "born": "Sat, 23 Feb 1985 12:00:00 GMT", "_updated": "Thu, 05 Sep 2019 05:12:45 GMT", "_created": "Thu, 05 Sep 2019 05:12:45 GMT", "_etag": "72e86f0b96ad492c49a8eef3dbb527aac3409e3f", "_links": {"self": {"title": "person", "href": "people/5d70994dec8f9500043e5fe2"}}}], "_links": {"parent": {"title": "home", "href": "/"}, "self": {"title": "people", "href": "people"}}, "_meta": {"page": 1, "max_results": 25, "total": 7}}
$ curl -i -G http://eve-demo.herokuapp.com/people --data-urlencode 'projection={"born": 0}'
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 2761
X-Total-Count: 7
Cache-Control: max-age=20
Expires: Mon, 16 Sep 2019 14:34:29 GMT
Last-Modified: Fri, 13 Sep 2019 08:34:26 GMT
Server: Eve/0.8 Werkzeug/0.14.1 Python/3.6.5
Date: Mon, 16 Sep 2019 14:34:09 GMT
X-Cache: MISS from w4m-mmm-almada-1
X-Cache-Lookup: HIT from w4m-mmm-almada-1:0
Via: 1.1 vegur, 1.1 w4m-mmm-almada-1 (squid/3.5.12)
Connection: keep-alive

{"_items": [{"_id": "5d70994dec8f9500043e5fe3", "firstname": "Julia", "lastname": "Red", "role": ["copy"], "location": {"address": "98 Yatch Road", "city": "San Francisco"}, "_updated": "Thu, 05 Sep 2019 05:12:45 GMT", "_created": "Thu, 05 Sep 2019 05:12:45 GMT", "_etag": "4cf5236b47951a074d9d526ba216bb6cfc57bc32", "_links": {"self": {"title": "person", "href": "people/5d70994dec8f9500043e5fe3"}}}, {"_id": "5d70994dec8f9500043e5fe4", "firstname": "Anne", "lastname": "White", "role": ["contributor", "copy"], "location": {"address": "32 Joseph Street", "city": "Ashfield"}, "_updated": "Thu, 05 Sep 2019 05:12:45 GMT", "_created": "Thu, 05 Sep 2019 05:12:45 GMT", "_etag": "9050d049a2d90c13f33516f47baae53d6c9f77be", "_links": {"self": {"title": "person", "href": "people/5d70994dec8f9500043e5fe4"}}}, {"_id": "5d7b5492fa78500004da6e92", "firstname": "bill", "lastname": "clinton", "_updated": "Fri, 13 Sep 2019 08:34:26 GMT", "_created": "Fri, 13 Sep 2019 08:34:26 GMT", "_etag": "cbac8162f6843a450c6e9eefc378ba6a03594069", "_links": {"self": {"title": "person", "href": "people/5d7b5492fa78500004da6e92"}}}, {"_id": "5d7b5492fa78500004da6e93", "firstname": "mitt", "lastname": "romney", "_updated": "Fri, 13 Sep 2019 08:34:26 GMT", "_created": "Fri, 13 Sep 2019 08:34:26 GMT", "_etag": "f1c2baba8f0eec777384547d9113643117287c07", "_links": {"self": {"title": "person", "href": "people/5d7b5492fa78500004da6e93"}}}, {"_id": "5d70994dec8f9500043e5fe0", "firstname": "John", "lastname": "Doe", "role": ["author"], "location": {"address": "422 South Gay Street", "city": "Auburn"}, "_updated": "Thu, 05 Sep 2019 05:12:45 GMT", "_created": "Thu, 05 Sep 2019 05:12:45 GMT", "_etag": "dc5c0ba4282ce1406235f4bfb198e7f8c4b5a433", "_links": {"self": {"title": "person", "href": "people/5d70994dec8f9500043e5fe0"}}}, {"_id": "5d70994dec8f9500043e5fe1", "firstname": "Serena", "lastname": "Love", "role": ["author"], "location": {"address": "363 Brannan St", "city": "San Francisco"}, "_updated": "Thu, 05 Sep 2019 05:12:45 GMT", "_created": "Thu, 05 Sep 2019 05:12:45 GMT", "_etag": "8d7bcd0d69af16c499d6bcf7542efcc7f654aab8", "_links": {"self": {"title": "person", "href": "people/5d70994dec8f9500043e5fe1"}}}, {"_id": "5d70994dec8f9500043e5fe2", "firstname": "Mark", "lastname": "Green", "role": ["copy", "author"], "location": {"address": "4925 Lacross Road", "city": "New York"}, "_updated": "Thu, 05 Sep 2019 05:12:45 GMT", "_created": "Thu, 05 Sep 2019 05:12:45 GMT", "_etag": "72e86f0b96ad492c49a8eef3dbb527aac3409e3f", "_links": {"self": {"title": "person", "href": "people/5d70994dec8f9500043e5fe2"}}}], "_links": {"parent": {"title": "home", "href": "/"}, "self": {"title": "people", "href": "people"}}, "_meta": {"page": 1, "max_results": 25, "total": 7}}

nicolaiarocci added a commit that referenced this pull request Sep 18, 2019
@nicolaiarocci nicolaiarocci merged commit 0a2bdab into pyeve:master Sep 18, 2019
@nicolaiarocci nicolaiarocci added this to the 0.10 milestone Sep 18, 2019
@nicolaiarocci
Copy link
Member

thanks!

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.

curl request in features.rst not working
2 participants