juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Bognar (JIRA)" <j...@apache.org>
Subject [jira] [Created] (JUNEAU-118) OpenAPI generator should look for Java Validator annotations.
Date Sat, 29 Jun 2019 15:21:00 GMT
James Bognar created JUNEAU-118:
-----------------------------------

             Summary: OpenAPI generator should look for Java Validator annotations.
                 Key: JUNEAU-118
                 URL: https://issues.apache.org/jira/browse/JUNEAU-118
             Project: Juneau
          Issue Type: New Feature
          Components: Code
    Affects Versions: 8.0.0
            Reporter: James Bognar


The OpenAPI generator depends heavily on the @Schema annotation. 

Enhance it to also work with Java Validation annotations:
 * *_@NotNull_* – validates that the annotated property value is not _null_
 * *_@AssertTrue_* – validates that the annotated property value is _true_
 * *_@Size_* – validates that the annotated property value has a size between the attributes _min_ and _max_;
can be applied to _String_, _Collection_, _Map_, and array properties
 * *_@Min_* – _v_alidates that the annotated property has a value no smaller than the _value_ attribute
 * *_@Max_* – validates that the annotated property has a value no larger than the _value_ attribute
 * _*@Email*_ – validates that the annotated property is a valid email address

Some annotations accept additional attributes, but the _message_ attribute is common to
all of them. This is the message that will usually be rendered when the value of the respective
property fails validation.

Some additional annotations that can be found in the JSR are:
 * _*@NotEmpty*_ – validates that the property is not null or empty; can be applied to _String_, _Collection_, _Map_ or _Array_values
 * _*@NotBlank*_ – can be applied only to text values and validated that the property is
not null or whitespace
 * _*@Positive*_ and _*@PositiveOrZero*_ – apply to numeric values and validate that
they are strictly positive, or positive including 0
 * _*@Negative*_ and _*@NegativeOrZero*_



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message