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
Implement include
query parameter
#163
Implement include
query parameter
#163
Conversation
Should we include |
bf7f80b
to
b60e7b5
Compare
Added to both multi and single entry query parameters. A 400 Bad Request exception has been added, this may be collected in a separate file with other custom exceptions that mainly sub-classes FastAPI's `HTTPException`. To provide an "empty" `include` parameter, the value has to be either "" or ''. If a resource not specified in the keys of optimade/server/routers/__init__.py's ENTRY_COLLECTIONS is provided in the value of `include` (and it's not an "empty" value) a 400 Bad Request error will be raised and returned.
b60e7b5
to
801086a
Compare
I started to play around with using a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks solid, thanks @CasperWA. Works nicely at my end.
What is your position on including other entry types, such as |
I guess |
Hmm. Looking further into the code on how relationships are handled in general it's a bit messy. The models only allow |
It works fine with Anyway, leaving the |
Bump to v0.5.0 Changes: - Possibility for Docker deployment for both the index meta-database server as well as the regular server (#140, @ltalirz, @CasperWA) - Test building and starting Docker images with GitHub Actions CI (#140, @CasperWA, @ml-evs, @ltalirz) - Remove `/index` from the index meta-database's base URL (#140, @ltalirz, @CasperWA) - `include` query parameter (#163, @CasperWA) - Rename `optimade/server/deps.py` to `optimade/server/query_params.py` (#163, @CasperWA) - Human-readable landing page for versioned base URLs, as well as for `/optimade` (#172, @ml-evs) - Move mapper aliases to config file and out of mapper classes (#175, @ml-evs) Bug fixes: - Properly build versioned base URLs (#178, @CasperWA)
Closes #94
This PR also changes the API slightly, in the sense that it renames
optimade/server/deps.py
tooptimade/server/query_params.py
, as was first suggested in #162.Note: Support for providing relationship paths to
include
is not implemented, only endpoint names/entry types, e.g.,"references"
.