Repository navigation
fix: ibge/uf populacao_estimada quebrada (regressão do #877) - #881
Merged
Merged
Conversation
O fix de lint do #877 trocou `==` por `===` na comparação com ESTIMATED_POPULATION_VARIABLE_ID (9324), mas o IBGE retorna o id como STRING ('9324') no JSON do agregado → `'9324' === 9324` é false → data.find retorna undefined → InternalError('Empty data') → 500 em /api/ibge/uf/v1/[code] (produção e CI). Fix: Number(item.id) === ESTIMATED_POPULATION_VARIABLE_ID. Também corrige o InternalError que recebia string em vez de objeto (message ficava vazia no JSON de erro). Co-authored-by: Hermes Agent <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This was referenced Aug 10, 2026
lucianopf
added a commit
that referenced
this pull request
Aug 10, 2026
* fix: expõe feriados estaduais na rota /feriados/v1/{ano}?uf=XX
O #866 implementou a lógica de feriados estaduais no service
(getHolidays(year, state)) com testes, mas a rota não repassava o
parâmetro UF — o recurso ficou inacessível via API.
- rota lê query uf e repassa ao service
- UF inválida → 400 JSON (invalid_uf) em vez de 500
- doc OpenAPI atualizada com param uf opcional
- testes E2E: uf=SP retorna feriado estadual; uf=XX → 400
Co-authored-by: Hermes Agent <[email protected]>
* fix: docs quebradas — schemas Class/Group/Section/Division e AddressV3 ausentes
As docs (brasilapi.com.br/docs) quebravam com 'Invalid reference token:
Class' no Redoc. Causa: os rebases #862 (CNAE) e #867 (CEP v3) trouxeram
refs #/components/schemas/Class (4x) e AddressV3 sem as definições dos
schemas — o merge do lodash deixa refs órfãs.
- ibge.json: adiciona schemas Class/Group/Section/Division (do PR original #361)
- cep.json: adiciona schema AddressV3 (derivado do AddressV2, mesmo shape)
- teste preventivo: todas as refs #/components/schemas/* resolvem na spec completa
Co-authored-by: Hermes Agent <[email protected]>
* test: skip quando IBGE bloqueia o runner (ibge-populacao-fix)
O teste merged no #881 faz chamada real ao IBGE — no runner do GH
Actions o provider bloqueia e o teste estoura timeout de 60s,
derrubando o E2E de TODOS os PRs. Aplicando o padrão health-check +
describe.skipIf usado nos outros testes de providers (#868/#869).
Co-authored-by: Hermes Agent <[email protected]>
---------
Co-authored-by: Hermes Agent <[email protected]>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



🔴 Regressão do #877 (meu fix de lint)
O lint fix do #877 trocou
==por===na comparação deitem.idcomESTIMATED_POPULATION_VARIABLE_ID(9324). O IBGE retorna o id como string ("9324") no JSON do agregado →'9324' === 9324éfalse→data.findretorna undefined →InternalError('Empty data')→ 500 em /api/ibge/uf/v1/[code] (produção + CI).Fix
Number(item.id) === ESTIMATED_POPULATION_VARIABLE_ID(compara como número)new InternalError({ message: 'Empty data' })— o construtor espera objeto (antes recebia string →messagevazio no JSON de erro)Verificação
getUfEstimatePopulationByCode('35')e('SP')retornampopulacao_estimadanumérico ✓ (2/2)