Hi Ross
Interesting to hear @Florin Tene view on this, as the owner of the design guidelines.
Need to consider the following aspects:
- I don't think that it's possible to write null (as in the JSON elementary value) in a simple filter on the HTTP GET query string, since its formal interpretation would be a string with value "null" (i.e. the four letters n u l and l)
- Assuming your target column/document/element is of type string, how can you represent an empty string value in the HTTP GET query string
- I don't know enough about JSON Path syntax to be sure, but I would guess that it does allow you to represent null correctly
If we've solved the query string representation, now consider the results. Basically, why would you reject such a query? It is legitimate, as you say, for a queryable field to be empty. And even for a field that is notionally mandatory (such as name in the catalog entities) it might happen that actual data items violate the constraint and you want your query to find such items.
Still you need to consider the semantic difference between null and empty string, if such a difference exists in your persistence layer.
Hope it helps
------------------------------
Jonathan Goldberg
Amdocs Management Limited
Any opinions and statements made by me on this forum are purely personal, and do not necessarily reflect the position of the TM Forum or my employer.
------------------------------
Original Message:
Sent: Mar 20, 2023 13:04
From: Ross Oliver
Subject: Null/Empty Filtering Values
Hey there, we are implementing TMF620 and 633. What is the accepted way to handle null or empty filtering values?
e.g.
"?name= "
"?name=null"
It seems reasonable that a string value could be null or empty? Or should these type of queries be rejected with an appropriate error?
------------------------------
Ross Oliver
Hansen Technologies
------------------------------