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

Swagger for search #630

Merged
merged 3 commits into from
Aug 19, 2019
Merged

Swagger for search #630

merged 3 commits into from
Aug 19, 2019

Conversation

karannaoh
Copy link
Member

No description provided.

@codecov-io
Copy link

codecov-io commented Aug 9, 2019

Codecov Report

Merging #630 into master will decrease coverage by 0.04%.
The diff coverage is 55.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #630      +/-   ##
==========================================
- Coverage   93.52%   93.48%   -0.05%     
==========================================
  Files         284      284              
  Lines       25116    25141      +25     
==========================================
+ Hits        23490    23503      +13     
- Misses       1626     1638      +12
Impacted Files Coverage Δ
guillotina/api/registry.py 85.56% <ø> (ø) ⬆️
guillotina/api/content.py 89.89% <ø> (ø) ⬆️
guillotina/api/behaviors.py 100% <ø> (ø) ⬆️
guillotina/api/addons.py 100% <ø> (ø) ⬆️
guillotina/api/files.py 98.98% <ø> (ø) ⬆️
guillotina/api/storage.py 92.85% <ø> (ø) ⬆️
guillotina/api/types.py 100% <ø> (ø) ⬆️
guillotina/json/definitions.py 100% <100%> (ø) ⬆️
guillotina/api/search.py 97.82% <100%> (+0.04%) ⬆️
guillotina/api/service.py 81.39% <52%> (-7.29%) ⬇️

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 9ee7910...8c407c4. Read the comment docs.

@karannaoh
Copy link
Member Author

#616

Copy link
Member

@vangheem vangheem left a comment

Choose a reason for hiding this comment

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

Looks really close--just a couple more tweaks.

data = self.request.url.query
for parameter in self.__config__['parameters']:
if parameter['in'] == 'query':
if parameter['schema']['type'] == 'integer':
Copy link
Member

Choose a reason for hiding this comment

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

Could we handle KeyError here?

Copy link
Member Author

Choose a reason for hiding this comment

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

keyError for parameter['schema']['type']?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, if they define a parameter without the schema defined

I imagine it already default to string so you don't need to define this.

if parameter['in'] == 'query':
if parameter['schema']['type'] == 'integer':
try:
int(data[parameter['name']])
Copy link
Member

Choose a reason for hiding this comment

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

Before all this, shouldn't we first check if name is in data?

})
else:
pass
if parameter['required'] and parameter['name'] not in data:
Copy link
Member

Choose a reason for hiding this comment

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

what if they don't define required?

Maybe the whole check should be wrapped in KeyError handling?

@vangheem vangheem merged commit b2dc19a into master Aug 19, 2019
@vangheem vangheem deleted the swagger-for-search branch August 19, 2019 15:44
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