airr-community / adc-api

AIRR Data Commons (ADC) API reference implementation
GNU Affero General Public License v3.0
1 stars 0 forks source link

contains op does not give error when number value is passed #6

Closed schristley closed 4 years ago

schristley commented 4 years ago

contains should only work for string.

schristley commented 4 years ago

the original test was passing a number but because the field is a string in the schema, so the value is transformed into a string for the query, thus why the test passed.

{
   "filters": {
     "op":"contains",
     "content": {
       "field":"sample.cell_phenotype",
       "value":45
     }
   }
 }

To actually test that contains is restricted to string, we should change the test to a field that is a number or other non-string.

schristley commented 4 years ago

Updated reference implementation so that it throws query error for contains on a non-string. Also added a couple of tests to check.