diff options
| author | Murilo Ijanc <[email protected]> | 2026-07-27 20:42:18 -0300 |
|---|---|---|
| committer | Murilo Ijanc <[email protected]> | 2026-07-27 20:42:18 -0300 |
| commit | 218bc8fbfbbdc2520130ef43652a6cd22a6e67fb (patch) | |
| tree | 4291a5bb3a235a21b44cfbc51bf1d0c6b9af0c3e /dune-project | |
| parent | 5598ea80735a51cb7b3690837b2b7d4240331b2d (diff) | |
| download | ocaml-1e24c8acae5286ca3d6a5aa35efaf61508b57b0f.tar.gz | |
A CEP that fails a lookup is rarely a random number. It is usually
someone who knows the city and guessed the digits, and the classic guess
is the -000 that 957 municipalities never received. The API now answers
those 404s with a faixa naming the municipality whose band the number
falls into, so a caller can ask "did you mean somewhere in Areal/RJ?"
instead of returning a bare "not found".
Cep_not_found becomes an inline record so the context rides along with
the message, matching how Rate_limited and Server_error already carry
theirs. It is still a 404: faixa is context on the failure and never
promotes it to an address, and its bounds are the smallest and largest
CEP that actually exist there — sparse across the interval, which is
what the ceps count is for — not the bounds the Correios publish.
Parsing is deliberately lenient. A missing, null, malformed or
municipality-less faixa yields None rather than an error: a 404 is a
clean answer, and no shape of this field should turn it into an
Invalid_response.
Diffstat (limited to 'dune-project')
| -rw-r--r-- | dune-project | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/dune-project b/dune-project index 3e7fa0f..cf8de14 100644 --- a/dune-project +++ b/dune-project @@ -2,7 +2,7 @@ (name cepis) -(version 0.1.0) +(version 0.2.0) (generate_opam_files true) |