Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Provide default descriptions for Hibernate Validator's BitcoinAddress, ISBN, Normalized, UniqueElements, and UUID constraints

Aperta
#1,065 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@chuuminggg ci sta già lavorando.

Dal 7/10/2026.

  • #1066 di @chuuminggg — aperta

Valutazione

Difficoltà
1/5
Tempo stimato
1-3 ore
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
java, spring
Ambito
documentation

Direzione di ricerca

Start by locating DefaultConstraintDescriptions.properties and the existing descriptions added in gh-454. Check the related tests for constraint descriptions, then verify descriptions are provided for the five listed Hibernate Validator constraints and that ConstraintDescriptions can retrieve them. An open pull request (#1066) is already linked, so coordinate with its author before starting.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

status: waiting-for-triage

DefaultConstraintDescriptions.properties does not provide descriptions for several field-level constraints that are available in Hibernate Validator 9.0 (the version in REST Docs' platform):

  • org.hibernate.validator.constraints.BitcoinAddress
  • org.hibernate.validator.constraints.ISBN
  • org.hibernate.validator.constraints.Normalized
  • org.hibernate.validator.constraints.UniqueElements
  • org.hibernate.validator.constraints.UUID

As a result, documenting a property that uses one of them fails unless the user provides their own ConstraintDescriptions.properties:

static class Book {

    @UUID
    String id;

}

new ConstraintDescriptions(Book.class).descriptionsForProperty("id");
java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key org.hibernate.validator.constraints.UUID.description

I understand from #371 that failing for an undescribed constraint is intentional, so rather than changing that behavior, I'd like to propose adding default descriptions for these constraints, similar to what was done in gh-454:

Constraint Proposed description
BitcoinAddress Must be a well-formed Bitcoin address
ISBN Must be a well-formed ISBN
Normalized Must be normalized using Unicode normalization form ${form}
UniqueElements Must only contain unique elements
UUID Must be a well-formed UUID

There are a few other Hibernate Validator constraints that also have no default description, but I've left them out as they may need a decision first:

  • time.DurationMin and time.DurationMax: Hibernate Validator's own message uses EL to only include the non-zero parts of the duration, which I don't think can be expressed with the ${…} placeholders that are available. Should these be described in terms of all of their attributes, or left to users?
  • Country-specific constraints (br.CPF, br.CNPJ, br.TituloEleitoral, pl.NIP, pl.PESEL, pl.REGON, ru.INN, kor.KorRRN): none are described at the moment. Would you like descriptions for these too?

I'm happy to submit a pull request for this.

Lingua principale
Java
Stelle
1.2k
Fork
731
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di spring-projects/spring-restdocs

Tutte le issue di spring-projects/spring-restdocs

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.