1 package io.swagger.v3.oas.annotations.media;
2
3 import io.swagger.v3.oas.annotations.extensions.Extension;
4 import io.swagger.v3.oas.annotations.headers.Header;
5
6 import java.lang.annotation.Inherited;
7 import java.lang.annotation.Retention;
8 import java.lang.annotation.RetentionPolicy;
9 import java.lang.annotation.Target;
10
11 /**
12 * The annotation may be used to add encoding details to the definition of a parameter, request or response content,
13 * by defining it as field {@link Content#encoding()}
14 *
15 * @see <a target="_new" href="https://github.com/OAI/OpenAPI-Specification/blob/3.0.1/versions/3.0.1.md#encodingObject">Encoding (OpenAPI specification)</a>
16 * @see Content
17 **/
18 @Target({})
19 @Retention(RetentionPolicy.RUNTIME)
20 @Inherited
21 public @interface Encoding {
22
23 /**
24 * The name of this encoding object instance.
25 * This property is a key in encoding map of MediaType object and
26 * MUST exist in a schema as a property.
27 *
28 * @return name of the encoding
29 **/
30 String name() default "";
31
32 /**
33 * The Content-Type for encoding a specific property.
34 *
35 * @return content type of the encoding
36 **/
37 String contentType() default "";
38
39 /**
40 * Describes how a specific property value will be serialized depending on its type
41 *
42 * @return style of the encoding
43 **/
44 String style() default "";
45
46 /**
47 * When this is true, property values of type array or object generate separate parameters for each value of the array,
48 * or key-value-pair of the map.
49 *
50 * @return boolean
51 **/
52 boolean explode() default false;
53
54 /**
55 * Determines whether the parameter value SHOULD allow reserved characters,
56 * as defined by RFC3986 to be included without percent-encoding.
57 *
58 * @return boolean
59 **/
60 boolean allowReserved() default false;
61
62 /**
63 * An array of header objects
64 *
65 * @return array of headers
66 */
67 Header[] headers() default {};
68
69 /**
70 * The list of optional extensions
71 *
72 * @return an optional array of extensions
73 */
74 Extension[] extensions() default {};
75
76 }
77