<feed xmlns='http://www.w3.org/2005/Atom'>
<title>swift/Tests/CepisTests/CepisTests.swift, branch v0.2.0</title>
<subtitle>Swift client for the public CEP API
</subtitle>
<id>http://git.cep.is/swift/atom?h=v0.2.0</id>
<link rel='self' href='http://git.cep.is/swift/atom?h=v0.2.0'/>
<link rel='alternate' type='text/html' href='http://git.cep.is/swift/'/>
<updated>2026-07-27T23:33:24Z</updated>
<entry>
<title>Carry the municipality on a not-found CEP</title>
<updated>2026-07-27T23:33:24Z</updated>
<author>
<name>Murilo Ijanc</name>
<email>murilo@ijanc.org</email>
</author>
<published>2026-07-27T23:33:24Z</published>
<link rel='alternate' type='text/html' href='http://git.cep.is/swift/commit/?id=d7ca2d6f4b1c5c1f5f1b6ce6ffad35aaffee5b0f'/>
<id>urn:sha1:d7ca2d6f4b1c5c1f5f1b6ce6ffad35aaffee5b0f</id>
<content type='text'>
A CEP that fails a lookup is rarely a random number: it is almost always
someone who knows the city and guessed the digits. The classic guess is
the -000, which 957 municipalities never received. Answering that with a
bare "not found" throws away what the API knows — that the number is in
Areal/RJ's band — and leaves the caller unable to tell a typo apart from
a city that has no such CEP.

The 404 now carries an optional faixa, so cepNotFound carries it too. It
decorates the error and never replaces it: the CEP still does not exist
and the call still throws. Parsing is deliberately incapable of
escalating — a faixa that is absent, null, empty or malformed becomes
nil, because losing the decoration must never cost the clean not-found
underneath it.

Faixa offers no contains(): cep_ini and cep_fim are the smallest and
largest CEP that actually exist, not the bounds the Correios publish,
and the range between them is sparse — Areal's 118 CEPs are spread over
some 4,900 numbers. Only a lookup can answer whether a CEP exists, and
an API that appeared to answer it from the pair would be lying.

Widening cepNotFound's payload breaks anyone matching the case with a
single binding, hence 0.2.0.
</content>
</entry>
<entry>
<title>Initial import</title>
<updated>2026-07-26T15:18:32Z</updated>
<author>
<name>Murilo Ijanc</name>
<email>murilo@ijanc.org</email>
</author>
<published>2026-07-26T15:18:32Z</published>
<link rel='alternate' type='text/html' href='http://git.cep.is/swift/commit/?id=72a4b451c9d06f7a97cac2f43f1b7f52fafcd3b7'/>
<id>urn:sha1:72a4b451c9d06f7a97cac2f43f1b7f52fafcd3b7</id>
<content type='text'>
</content>
</entry>
</feed>
