Test Orders API tools parameters
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start in planet/order_request.py at _tool() and harmonize_tool(), then inspect the planet.specs validate_tool implementation and the related issue #793. Trace how Orders API tool parameters are checked against the OpenAPI spec. Done means invalid parameter values fail validation without relying on manually maintained parameter lists.
Written by the indexing model from the issue text.
Description
Expected behavior
When testing tools for the Orders API, I'd expect the tool name and the parameters to be validated.
Actual behavior (describe the problem)
When testing tools for the Orders API, only the tool name appears to be validated.
This seems to happen in the function _tool(). It looks like our tools get passed to _tool(), which validates the tool name, but not the tool’s parameters.
For instance, for harmonize_tool() could get passed any sort of target sensor name and the test won’t fail, because it’s only looking to see if the tool name, ‘harmonize’, is a valid tool, not if the parameter, sensor_name, is valid.
Related Issues
I created a ticket a month ago (#793), which sort of fixes this issue for harmonize_tool(), but doesn’t really do so.
Workaround
None.
Minimum, Complete, Viable Code Sample
Current solution in planet.specs:
def validate_tool(tool):
return _validate_field(tool, SUPPORTED_TOOLS, 'tool')
Proposed solution in planet.specs:
def validate_tool_name(tool):
return _validate_field(tool, SUPPORTED_TOOLS, 'tool')
def validate_tool_parameter(parameter):
return _validate_field(parameter, SUPPORTED_PARAMS, 'parameter')
However, the issue here is that we'd be manually supplying SUPPORTED_PARAMS, which is it's own issue, because we need to continually manually check these against the openAPI spec.
- Dominant language
- Python
- Stars
- 300
- Forks
- 100
- Avg merge
- 9d 22h
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from planetlabs/planet-client-python
-
better-testing
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
planetlabs/planet-client-python#1110 ·
-
proposal
Difficulty 3/5 1-2 days Newbie friendliness 65/100
planetlabs/planet-client-python#1221 ·
-
proposal
Difficulty 3/5 1-2 days Newbie friendliness 57/100
planetlabs/planet-client-python#1214 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 48/100
planetlabs/planet-client-python#1197 · 1 comment · 1 reaction ·
-
Quota APIMay be free again @asonnenschein claimed this 415 days ago, and no pull request is open. Openai-claude
planetlabs/planet-client-python#1191 · 1 comment · 1 assignee ·
All issues in planetlabs/planet-client-python
Similar issues
-
#bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
apache/superset#44923 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
lawndoc/stack-back#123 ·
-
Add: EntuneOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
AbdelStark/awesome-typesafe-jev#187 ·
Maintainers usually reply within 1 day
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
repowise-dev/repowise#2966 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 2 days