fix: parse boolean query params from strings - #134
Merged
Merged
Conversation
SpicyGarlicAlbacoreRoll
approved these changes
Sep 17, 2026
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Needed for TOOL-5054 (single observation search in Vertex). Boolean keywords like
jointObservationarrive as strings in the request, andbool("false")isTrue, sojointobservation=falsereturned the same results astrue. Kim suggested handling this in SearchAPI with thestring_to_obj_map.Description
Added a small
string_to_booland mappedboolto it instring_to_obj_map, so "true"/"false" (any case) are parsed correctly forjointObservationandcollectionAlias. Other strings (like "asdf") now return a 400 instead of quietly becoming true. No packaging changes, no new endpoints.Snippet
curl 'http://127.0.0.1:8080/services/search/param?dataset=NISAR&processinglevel=RSLC&output=count&jointobservation=false'Before: same count as
jointobservation=true(20272). After: 118427 (no filter is 138699, so joint + single add up).jointobservation=asdfnow returns400 {"error": {"type": "ERROR", "report": "ValueError('Invalid boolean: asdf')"}}.Error/Warning/Regression Free
Checked locally with the app for GET, POST and
output=python(the script now shows"jointObservation": False).Unit Tests
Added
tests/unit/test_asf_opts.py(3 tests) and two yml cases: 200 with "false" and 400 with "asdf".Target Merge Branch
test
Checklist