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

Remove relative links #1541

Merged
merged 2 commits into from Jun 16, 2017
Merged

Conversation

r-marques
Copy link
Contributor

resolves #1525

  • Outputs now return and object with {'txid': 'aaa', 'output': 0} instead of links
  • Statuses endpoints only returns the status
  • Remove the documented Location HTTP headers since they are not implemented

@codecov-io
Copy link

codecov-io commented Jun 14, 2017

Codecov Report

Merging #1541 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff            @@
##           master   #1541      +/-   ##
=========================================
+ Coverage    98.4%   98.4%   +<.01%     
=========================================
  Files          58      58              
  Lines        2818    2819       +1     
=========================================
+ Hits         2773    2774       +1     
  Misses         45      45

- Updated documentation
- Updated tests
- Updated documentation
- Updated tests
@r-marques r-marques force-pushed the feat/1525/inconsistency-relative-links branch from 0f19da5 to 4d1131d Compare June 16, 2017 08:05
@@ -24,5 +24,5 @@ def get(self):
with pool() as bigchain:
outputs = bigchain.get_outputs_filtered(args['public_key'],
include_spent)
# NOTE: We pass '..' as a path to create a valid relative URI
return [u.to_uri('..') for u in outputs]
Copy link
Contributor

Choose a reason for hiding this comment

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

The to_uri method might have only been used for this API endpoint.

As we're not using it here anymore, we might want to check if we cannot simply remove it now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is still being used for instance to check that all the inputs in a transaction are unique. I guess the same could be achieve without it since the TransactionLink implements __hash__ but that requires some refactor that was not in the scope of this pr

@@ -265,16 +267,10 @@ Statuses

**Example response**:

.. literalinclude:: http-samples/get-statuses-block-invalid-response.http
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Before if the block was invalid it only returned the status. If it was valid it would return the status and _links.
Now it always returns only the status key so I though the two example responses were redundant.

Copy link
Contributor

@TimDaub TimDaub left a comment

Choose a reason for hiding this comment

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

I found some more occurrences:

// not so sure about the ones from //docs? Are they local?
docs/server/source/drivers-clients/samples/get-statuses-block-valid-response.http
6:  "_links": {

docs/server/source/drivers-clients/samples/api-index-response.http
5:  "_links": {

docs/server/source/drivers-clients/samples/index-response.http
5:  "_links": {

docs/server/source/drivers-clients/samples/get-statuses-tx-valid-response.http
6:  "_links": {

// this one we should definitely take care of
tests/web/test_websocket_server.py
171:    ws_url = client.get('http://localhost:9984/api/v1/').json['_links']['streams_v1']

@r-marques
Copy link
Contributor Author

Remove the docs build folder and rebuild the docs. There should be no more _links in the documentation.

The test is being skipped so I did not change it.

@r-marques r-marques merged commit 8d60796 into master Jun 16, 2017
@vrde vrde deleted the feat/1525/inconsistency-relative-links branch March 21, 2018 15:02
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.

Inconsistency in using relative links
3 participants