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

Move entry schemas to separate submodule #511

Merged
merged 6 commits into from Sep 22, 2020
Merged

Conversation

ml-evs
Copy link
Member

@ml-evs ml-evs commented Sep 21, 2020

This PR is a shortcut version of #277 whilst retaining most of its features. The ENTRY_INFO_SCHEMA constant dict has been moved to a new submodule and new extension fields ("support" and "queryable") are now made available so they can also be used by the validator more cleanly in #503, and eventually in the server code in #504.

All that is missing to enable #277 is to wrap this in a class to provide a nicer interface for implementations to use their own models in ENTRY_INFO_SCHEMAS rather than the hardcoded StructureResource etc. I think this is a less important point than the other bits though.

@ml-evs ml-evs added enhancement New feature or request priority/medium Issue or PR with a consensus of medium priority labels Sep 21, 2020
@codecov
Copy link

codecov bot commented Sep 21, 2020

Codecov Report

Merging #511 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #511   +/-   ##
=======================================
  Coverage   91.59%   91.59%           
=======================================
  Files          61       62    +1     
  Lines        3118     3119    +1     
=======================================
+ Hits         2856     2857    +1     
  Misses        262      262           
Flag Coverage Δ
#project 91.59% <100.00%> (+<0.01%) ⬆️
#validator 63.73% <100.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
optimade/server/routers/utils.py 97.72% <ø> (-0.29%) ⬇️
optimade/server/routers/info.py 96.15% <100.00%> (ø)
optimade/server/schemas.py 100.00% <100.00%> (ø)

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 c34f8a0...c3285d8. Read the comment docs.

Copy link
Member

@CasperWA CasperWA left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks @ml-evs

On another note, are you sure we don't need to take allOf, anyOf, etc. into account in the recursive function?

@ml-evs
Copy link
Member Author

ml-evs commented Sep 22, 2020

On another note, are you sure we don't need to take allOf, anyOf, etc. into account in the recursive function?

I'm sure for now... I think the problem we were having was also providing a schema for the links endpoint, which was running into the multiple allowed response types. We don't have that anywhere in our structure/reference models so this should be useful as is.

@ml-evs ml-evs merged commit 995f32d into master Sep 22, 2020
@ml-evs ml-evs deleted the ml-evs/entry_schemas branch September 22, 2020 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority/medium Issue or PR with a consensus of medium priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants