feat(validation): limites de inputs, mensajes de error y manejo de caracteres inusuales#10
Merged
Merged
Conversation
Caracteres raros/inusuales que rompian el parseo del body o la conversion de parametros devolvian 500. Ahora se capturan explicitamente y retornan 400 INVALID_INPUT con el mensaje "The submitted input is invalid or contains unsupported characters". Handlers anadidos: - HttpMessageNotReadableException (body no parseable/JSON invalido) - HttpMessageConversionException (error de conversion de tipos) - MethodArgumentTypeMismatchException (parametro de tipo incorrecto) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Resumen
Dos commits de mejora a la validación de inputs:
INVALID_INPUTcon mensaje claro en vez de error interno.Cambios
Límites de inputs
TaskRequest.storyPoints: acotado a1–21(escala Fibonacci).StatusChangeRequest.actualHours:@Positive, máx999.99, hasta 2 decimales.UserController.searchByEmail:@Validated+ param@NotBlank @Email @Size(max=100).DashboardController.velocity:@Validated+sprintsacotado a1–50.LoginRequest.password: máx 100 caracteres (alineado con el registro).max-page-size=500,default-page-size=20.Manejo de errores de parseo (caracteres inusuales)
HttpMessageNotReadableException→ 400INVALID_INPUT(body no parseable, unicode roto, JSON inválido).HttpMessageConversionException→ 400INVALID_INPUT(error de conversión de tipos).MethodArgumentTypeMismatchException→ 400INVALID_INPUTcon el campo afectado.Mejora general de mensajes
GlobalExceptionHandlerantepone el nombre del campo en errores de body (campo: mensaje).ConstraintViolationException→ 400 en vez de 500 para query params inválidos.Notas
ErrorResponse → api.js → toast.error()ya los muestra).🤖 Generated with Claude Code