BrasilAPI / BrasilAPI/cep-promise

Validação do formato do CEP

Open
#260 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3k
Forks
317
PR merge metrics
No merged PRs in 30d

Description

Fala gente, tudo bem?

Estou implementando o cep-promise aqui em um projeto e pensei que poderíamos validar o formato do CEP antes de enviar para as APIs de busca.

Meu ponto é que a gente acaba fazendo chamadas desnecessárias, pois já que o formato está errado, não irá retornar nenhum resultado.

Minha idéia seria validar para que o valor contenha apenas números, pois hoje se passarmos uma string com 8 caractéres, o serviço faz a busca. O que acham?

Contributor guide

Open the contributing guide

Research direction

Start at the CEP input handling before requests are sent to the Correios, ViaCEP, or other lookup APIs. Trace how an eight-character string is currently accepted, then define completion as validating the proposed numeric format before making an API call and preserving lookup behavior for valid input.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.