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

Improve response_fields and sort query parameter regexes

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

Nobody has claimed this yet.

ergonomics good first issue models priority/low schema suggestions
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).

https://github.com/Materials-Consortia/optimade-python-tools/blob/ce8b4ddd1dbdf2a11ab2d8f2457eb2cac6624009/optimade/server/query_params.py#L110-L119

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.