Materials-Consortia / Materials-Consortia/optimade-python-tools
Shift more validation into the OpenAPI schema
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 91
- Forks
- 54
- PR merge metrics
- No merged PRs in 30d
Description
Some places where we could do this (please add):
- regexps for chemical formulae (#708)
- defining an elements type to constrain strings/arrays involving elements (e.g. the
elementsfield,species_at_sitesetc.) - provider validation should have patterns in the OpenAPI schema (#723)
Slight misdirection but there are quite a few other places that we could consider embedding validation into the OpenAPI, e.g.
elementswhich is currently just an array of strings, could instead be an array ofElements, i.e. strings that match the regexp/enum.
Originally posted by @ml-evs in https://github.com/Materials-Consortia/optimade-python-tools/issues/708#issuecomment-780497285
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the OpenAPI schema and reviewing how the existing chemical-formula and provider patterns were added. Investigate the unchecked elements type and its uses in fields such as elements and species_at_sites; done means the relevant schema constraints are defined and covered by the project’s validation checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, python
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100