Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow putting OpenApi annotations on fields in addition to methods #216

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified gradlew
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -160,21 +160,21 @@ annotation class OpenApiSecurity(
val scopes: Array<String> = []
)

@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER, FIELD)
@Retention(RUNTIME)
annotation class OpenApiIgnore

@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER, FIELD)
@Retention(RUNTIME)
annotation class OpenApiRequired

@Target(CLASS, FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
@Target(CLASS, FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER, FIELD)
@Retention(RUNTIME)
annotation class OpenApiName(
val value: String
)

@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER, FIELD)
@Retention(RUNTIME)
annotation class OpenApiExample(
val value: String = NULL_STRING,
Expand All @@ -189,14 +189,14 @@ annotation class OpenApiExampleProperty(
val objects: Array<OpenApiExampleProperty> = []
)

@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER, FIELD)
@Retention(RUNTIME)
@CustomAnnotation
annotation class OpenApiNullable(
val nullable: Boolean = true
)

@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER, CLASS)
@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER, FIELD, CLASS)
@Retention(RUNTIME)
annotation class OpenApiDescription(
val value: String
Expand All @@ -208,7 +208,7 @@ enum class Nullability {
AUTO
}

@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER, FIELD)
@Retention(RUNTIME)
annotation class OpenApiNumberValidation(
val minimum: String = NULL_STRING,
Expand All @@ -218,7 +218,7 @@ annotation class OpenApiNumberValidation(
val multipleOf: String = NULL_STRING
)

@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER, FIELD)
@Retention(RUNTIME)
annotation class OpenApiStringValidation(
val minLength: String = NULL_STRING,
Expand All @@ -227,22 +227,22 @@ annotation class OpenApiStringValidation(
val pattern: String = NULL_STRING
)

@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER, FIELD)
@Retention(RUNTIME)
annotation class OpenApiArrayValidation(
val minItems: String = NULL_STRING,
val maxItems: String = NULL_STRING,
val uniqueItems: Boolean = false
)

@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER, FIELD)
@Retention(RUNTIME)
annotation class OpenApiObjectValidation(
val minProperties: String = NULL_STRING,
val maxProperties: String = NULL_STRING,
)

@Target(CLASS, FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
@Target(CLASS, FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER, FIELD)
@Retention(RUNTIME)
annotation class OpenApiPropertyType(
val definedBy: KClass<*>,
Expand Down
Loading