Provide default descriptions for Hibernate Validator's BitcoinAddress, ISBN, Normalized, UniqueElements, and UUID constraints
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
- 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
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.BitcoinAddressorg.hibernate.validator.constraints.ISBNorg.hibernate.validator.constraints.Normalizedorg.hibernate.validator.constraints.UniqueElementsorg.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.DurationMinandtime.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
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di spring-projects/spring-restdocs
-
Upgrade to Spring Framework 7.0.10Forse già presa @wilkinsona l’ha presa 6 giorni fa. Apertatype: dependency-upgrade
spring-projects/spring-restdocs#1063 · 1 assegnatario ·
-
Upgrade to Spring Framework 7.1.0-RC1Forse già presa @wilkinsona l’ha presa 6 giorni fa. Apertatype: dependency-upgrade
spring-projects/spring-restdocs#1062 · 1 assegnatario ·
-
Support extracting Bean Validation constraints from method parametersForse già presa @JunggiKim l’ha presa 190 giorni fa. Apertastatus: waiting-for-triage
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
spring-projects/spring-restdocs#1026 · 2 commenti ·
-
status: blocked status: waiting-for-triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
spring-projects/spring-restdocs#953 · 7 commenti ·
-
Add support for modifying a URI's path during pre-processingForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertatype: enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
Tutte le issue di spring-projects/spring-restdocs
Issue simili
-
[Bug] AI unread message badge counts a batch of new bubbles as one messageForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
apache/rocketmq-dashboard#5784 ·
I maintainer di solito rispondono entro 3 giorni
-
[i18n] 安装实例完成后的成功提示未正确本地化Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
PCL-Community/PCL-CE#3658 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
apache/skywalking#14127 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Team/Identity Server Core Type/Improvement U2
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
wso2/product-is#28553 ·
I maintainer di solito rispondono entro 1 giorno