Skip to content

Resolve internal references in Swagger spec#122

Merged
kislyuk merged 2 commits intomasterfrom
akislyuk-resolve-swagger-spec-refs
Jun 4, 2018
Merged

Resolve internal references in Swagger spec#122
kislyuk merged 2 commits intomasterfrom
akislyuk-resolve-swagger-spec-refs

Conversation

@kislyuk
Copy link
Copy Markdown
Member

@kislyuk kislyuk commented Jun 2, 2018

No description provided.

@kislyuk kislyuk requested a review from hannes-ucsc June 2, 2018 00:03
@codecov-io
Copy link
Copy Markdown

codecov-io commented Jun 2, 2018

Codecov Report

Merging #122 into master will increase coverage by 0.18%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #122      +/-   ##
==========================================
+ Coverage    86.6%   86.78%   +0.18%     
==========================================
  Files          29       29              
  Lines        1023     1037      +14     
==========================================
+ Hits          886      900      +14     
  Misses        137      137
Impacted Files Coverage Δ
hca/util/__init__.py 92.22% <100%> (+0.42%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce581b5...ddf8b92. Read the comment docs.

Comment thread hca/util/__init__.py Outdated
refs = []

def store_refs(d):
if len(d) == 1 and list(d)[0] == ptr_str:
Copy link
Copy Markdown
Contributor

@hannes-ucsc hannes-ucsc Jun 3, 2018

Choose a reason for hiding this comment

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

Using next(iter(d)) or ptr_str in d for the second term is probably faster.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good idea, changed to ptr_str in d.

Comment thread hca/util/__init__.py
refs.append(d)
return d

swagger_content = json.load(swagger_json, object_hook=store_refs)
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.

object_hook, neat.

@kislyuk kislyuk merged commit 21fc4dd into master Jun 4, 2018
@kislyuk kislyuk deleted the akislyuk-resolve-swagger-spec-refs branch June 4, 2018 15:58
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