1 package io.swagger.v3.oas.annotations.media;
2
3 import io.swagger.v3.oas.annotations.OpenAPI31;
4
5 import java.lang.annotation.Inherited;
6 import java.lang.annotation.Repeatable;
7 import java.lang.annotation.Retention;
8 import java.lang.annotation.RetentionPolicy;
9 import java.lang.annotation.Target;
10
11 import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
12 import static java.lang.annotation.ElementType.FIELD;
13 import static java.lang.annotation.ElementType.METHOD;
14 import static java.lang.annotation.ElementType.PARAMETER;
15 import static java.lang.annotation.ElementType.TYPE;
16
17 /**
18  * The annotation may be used to define dependent schemas for an Object Schema
19  *
20  * @see Schema
21  *
22  * @since 2.2.12 / OpenAPI 3.1
23  **/

24 @Target({FIELD, METHOD, PARAMETER, TYPE, ANNOTATION_TYPE})
25 @Retention(RetentionPolicy.RUNTIME)
26 @Inherited
27 @Repeatable(DependentRequiredMap.class)
28 @OpenAPI31
29 public @interface DependentRequired {
30     /**
31      * The name.
32      *
33      * @return the name
34      **/

35     String name() default "";
36
37     /**
38      * The values of the dependent schema.
39      *
40      * @return the schema
41      **/

42     String[] value() default {};
43
44 }
45