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

Do not enforce minimum value of page_number at model level #1369

Merged
merged 2 commits into from Oct 26, 2022

Conversation

ml-evs
Copy link
Member

@ml-evs ml-evs commented Oct 25, 2022

  • This is to avoid spurious constraints being added to the OpenAPI schema
  • Instead, validate the value on creation of overall QueryParameter model.

(see discussion at Materials-Consortia/schemas#8)

Closes #1372

@ml-evs ml-evs added the OpenAPI OpenAPI / Swagger related issue label Oct 25, 2022
@ml-evs ml-evs force-pushed the ml-evs/fix_page_number_schemas branch 3 times, most recently from aa3f0b3 to 38d8b58 Compare October 25, 2022 14:51
@codecov
Copy link

codecov bot commented Oct 25, 2022

Codecov Report

Merging #1369 (486adf4) into master (01cb55d) will increase coverage by 0.14%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1369      +/-   ##
==========================================
+ Coverage   91.45%   91.59%   +0.14%     
==========================================
  Files          72       72              
  Lines        4366     4369       +3     
==========================================
+ Hits         3993     4002       +9     
+ Misses        373      367       -6     
Flag Coverage Δ
project 91.59% <100.00%> (+0.14%) ⬆️
validator 91.52% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
optimade/server/query_params.py 98.27% <ø> (ø)
...made/server/entry_collections/entry_collections.py 97.77% <100.00%> (+0.05%) ⬆️
optimade/client/client.py 81.70% <0.00%> (+2.43%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ml-evs ml-evs force-pushed the ml-evs/fix_page_number_schemas branch 3 times, most recently from fccf4e2 to da90d4a Compare October 25, 2022 17:19
- This is to avoid spurious constraints being added to the OpenAPI
  schema
- Validate page number dynamically for database queries
- Add test for `page_number` validation
@ml-evs ml-evs force-pushed the ml-evs/fix_page_number_schemas branch from da90d4a to 4ece278 Compare October 25, 2022 18:46
@ml-evs ml-evs marked this pull request as ready for review October 25, 2022 18:53
@ml-evs ml-evs force-pushed the ml-evs/fix_page_number_schemas branch from 4ece278 to a210441 Compare October 25, 2022 19:12
Copy link
Contributor

@JPBergsma JPBergsma left a comment

Choose a reason for hiding this comment

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

LGTM

@ml-evs ml-evs merged commit 8922a35 into master Oct 26, 2022
@ml-evs ml-evs deleted the ml-evs/fix_page_number_schemas branch October 26, 2022 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OpenAPI OpenAPI / Swagger related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenAPI schema should not enforce recommended constraint on page_number
2 participants