Materials-Consortia / Materials-Consortia/optimade-python-tools

Make it easier to serve provider fields with validation

Open
#929 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ergonomics priority/medium
Dominant language
Python
Stars
91
Forks
54
PR merge metrics
No merged PRs in 30d

Description

Following the discussion from #925, we should make it easier to extend our models and make sure they get used for validation in the API.

Currently, this requires changing the associated endpoint, entry collection and mapper code to get working (as many have done in our forked implementations). This should be something that is configurable, presumably via something like: "data_models": {"structures": MyStructureModel} in the config (which can then set the appropriate entry info schemas, mapper resource class, collection response class etc.).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the discussion in #925, then trace how the associated endpoint, entry collection, and mapper currently connect. Determine how a configurable data_models structure could provide the entry info schemas, mapper resource class, and collection response class while preserving API validation. Done means provider-defined models can be configured and are used consistently for validation and responses.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.