Materials-Consortia / Materials-Consortia/optimade-python-tools
Improve response_fields and sort query parameter regexes
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 91
- Forks
- 54
- PR merge metrics
- No merged PRs in 30d
Description
Currently our regexes for response_fields and sort allow e.g. response_fields="chemical_formula_anonymous" through, where the field is treated as the quoted string '"chemical_formula_anonymous"'.
This is not ideal and can be fixed in the model regexes directly (which we should then push upstream for v1.0.1 of the spec).
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 in optimade/server/query_params.py at lines 110-119 and inspect the model regexes for response_fields and sort. Verify that quoted field values are rejected while valid unquoted values remain accepted, then confirm the regex changes are suitable for pushing upstream for v1.0.1 of the spec.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100