QUERY_STRING_NULL_HANDLING
Control how NULL values are interpreted in query string parameters.
Keywords
query_string_null_handling, query_null_handling, query_string_null, query_null
Syntax
query_null <mode>
query_string_null_handling <mode>Values
| Value | Description |
|---|---|
empty_string | Empty value (?param=) treated as empty string |
null_literal | String "null" treated as NULL |
null | Same as null_literal |
ignore | Empty values are ignored |
empty_key | Key without value (?param) treated as NULL |
Examples
Treat Empty as Empty String
sql
comment on function search(_query text) is
'HTTP GET
query_null empty_string';GET /search?_query= → _query = ''
Treat "null" String as NULL
sql
comment on function get_data(_filter text) is
'HTTP GET
query_null null_literal';GET /get-data?_filter=null → _filter = NULL
Empty Key as NULL
sql
comment on function optional_param(_value text) is
'HTTP GET
query_null empty_key';GET /optional-param?_value → _value = NULL
Related
- NpgsqlRest Options configuration - Configure default null handling
- Comment Annotations Guide - How annotations work
- Configuration Guide - How configuration works
Related Annotations
- REQUEST_PARAM_TYPE - Control parameter source
- RESPONSE_NULL_HANDLING - NULL in responses