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

Conversation

@karannaoh
Copy link
Member

karannaoh commented Aug 9, 2019

No description provided.

@karannaoh karannaoh requested review from bloodbare and vangheem as code owners Aug 9, 2019
@karannaoh karannaoh added the wip label Aug 9, 2019
@codecov-io

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member Author

karannaoh commented Aug 11, 2019

@karannaoh karannaoh removed the wip label Aug 16, 2019
@karannaoh karannaoh force-pushed the swagger-for-search branch from 42e2b9c to ea3de1a Aug 16, 2019
Copy link
Member

vangheem left a comment

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':

This comment has been minimized.

Copy link
@vangheem

vangheem Aug 16, 2019

Member

Could we handle KeyError here?

This comment has been minimized.

Copy link
@karannaoh

karannaoh Aug 16, 2019

Author Member

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

This comment has been minimized.

Copy link
@vangheem

vangheem Aug 16, 2019

Member

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']])

This comment has been minimized.

Copy link
@vangheem

vangheem Aug 16, 2019

Member

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

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

This comment has been minimized.

Copy link
@vangheem

vangheem Aug 16, 2019

Member

what if they don't define required?

Maybe the whole check should be wrapped in KeyError handling?

@karannaoh karannaoh force-pushed the swagger-for-search branch from 35faae3 to 5f3654a Aug 19, 2019
@karannaoh karannaoh force-pushed the swagger-for-search branch from 5f3654a to a3d6a1c Aug 19, 2019
@karannaoh karannaoh requested a review from vangheem Aug 19, 2019
@vangheem vangheem merged commit b2dc19a into master Aug 19, 2019
3 of 5 checks passed
3 of 5 checks passed
codecov/patch 55.55% of diff hit (target 93.52%)
Details
codecov/project 93.48% (-0.05%) compared to 9ee7910
Details
Changelog verifier Entry found
Details
Plone Contributors Agreement verifier All users have signed it
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@vangheem vangheem deleted the swagger-for-search branch Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.