com.paas.swagger.annotations.ApiBeanProperty Maven / Gradle / Ivy
The newest version!
package com.paas.swagger.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* @ClassName ApiBeanProperty
* @Date 2021/2/6 14:52
* @Auther wangyongyong
* @Version 1.0
* @Description bean 属性注解
*/
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
//@Retention(RetentionPolicy.SOURCE) //正式发布启用该配置
public @interface ApiBeanProperty
{
/**
* A brief description of this property.
*/
String value() default "";
/**
* Allows overriding the name of the property.
*
* @return the overridden property name
*/
String name() default "";
/**
* Limits the acceptable values for this parameter.
*
* There are three ways to describe the allowable values:
*
* - To set a list of values, provide a comma-separated list.
* For example: {@code first, second, third}.
* - To set a range of values, start the value with "range", and surrounding by square
* brackets include the minimum and maximum values, or round brackets for exclusive minimum and maximum values.
* For example: {@code range[1, 5]}, {@code range(1, 5)}, {@code range[1, 5)}.
* - To set a minimum/maximum value, use the same format for range but use "infinity"
* or "-infinity" as the second value. For example, {@code range[1, infinity]} means the
* minimum allowable value of this parameter is 1.
*
*/
String allowableValues() default "";
/**
* A sample value for the property.
*/
String example() default "";
/**
* The data type of the parameter.
*
* This can be the class name or a primitive. The value will override the data type as read from the class
* property.
*/
String dataType() default "";
/**
* Specifies if the parameter is required or not.
*/
boolean required() default false;
/**
* Allows explicitly ordering the property in the model.
*/
int position() default 0;
/**
* Allows a model property to be hidden in the Swagger model definition.
*/
boolean hidden() default false;
}