-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A new data structure has been added to represent a gateway query response: `GatewayQueryResponse`. This new response changes the structure for the value of the top-level `data` field by always returning a dictionary/JSON object. The keys of the dictionary are the database `id`s and the value is a list of the returned resources from each database. In this way there is no need to alter/add anything to the returned resources, which has been the case up to now, where the `id` for each resource was prepended with the database `id`. This is however still in place, somewhat, if a `QueryResource` is not used for the query, but a straight-through result is desired. Then an OPTIMADE-compliant response is produced, where the database `id` is added as a `meta` entry to each returned resource. To handle this new approach a new utility function for processing an OPTIMADE database response has been written and implemented. An Enum for OPTIMADE endpoint entry types has been implemented with methods for returning the correct pydantic model for either the resources or response (both many and single), removing the need to pass the import path for these models. Make entry ID ambiguity a warning instead of an exception.
- Loading branch information
Showing
16 changed files
with
512 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.