View Source ExNominatim.Validations (ExNominatim v1.1.4)
Functions used for the automatic validation of the keys of a request parameters struct according to the target endpoint, their values according to the API endpoint's specification, and invalidate any request parameters with confusing intent that might have unexpected results, such as defining both the :q
free-form query parameter and at least one of the parameters of a structured query (:city
, :country
, etc.).
Summary
Functions
Show all fields and their explanations.
Given a request params struct (%ReverseParams{}
, %SearchParams{}
, etc.), a keyword list, or a list of atoms corresponding to keys, explain the fields, their default values (if any) and their values' limits (if applicable). It ignores any keyword list keys or atoms in the list that do not correspond to request parameters. If provided with the atom of a field, it returns the validation/explanation message for that field
Sanitizes the values of those fields of the params
request params struct (%SearchParams{}
, %ReverseParams{}
, etc.) that contain a comma-separated list of strings according to the Nominatim API specification. It collapses all spaces and trims and leading and trailing commas.
Validates the content and intent of a request represented by a request parameters struct params
(%SearchParams{}
, %ReverseParams{}
, etc.).
Functions
Show all fields and their explanations.
Given a request params struct (%ReverseParams{}
, %SearchParams{}
, etc.), a keyword list, or a list of atoms corresponding to keys, explain the fields, their default values (if any) and their values' limits (if applicable). It ignores any keyword list keys or atoms in the list that do not correspond to request parameters. If provided with the atom of a field, it returns the validation/explanation message for that field
Sanitizes the values of those fields of the params
request params struct (%SearchParams{}
, %ReverseParams{}
, etc.) that contain a comma-separated list of strings according to the Nominatim API specification. It collapses all spaces and trims and leading and trailing commas.
You can use this function directly if you want to combine it with ExNominatim.Validations.validate/1
.
Validates the content and intent of a request represented by a request parameters struct params
(%SearchParams{}
, %ReverseParams{}
, etc.).
You can use this function directly if you want to combine it with ExNominatim.HTTP.prepare/3
.