1 /**
2 * Copyright 2017 SmartBear Software
3 * <p>
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 * <p>
8 * http://www.apache.org/licenses/LICENSE-2.0
9 * <p>
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package io.swagger.v3.oas.annotations.media;
18
19 import io.swagger.v3.oas.annotations.extensions.Extension;
20 import io.swagger.v3.oas.annotations.headers.Header;
21
22 import java.lang.annotation.Inherited;
23 import java.lang.annotation.Retention;
24 import java.lang.annotation.RetentionPolicy;
25 import java.lang.annotation.Target;
26
27 /**
28 * The annotation may be used to add encoding details to the definition of a parameter, request or response content,
29 * by defining it as field {@link Content#encoding()}
30 *
31 * @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>
32 * @see Content
33 **/
34 @Target({})
35 @Retention(RetentionPolicy.RUNTIME)
36 @Inherited
37 public @interface Encoding {
38
39 /**
40 * The name of this encoding object instance.
41 * This property is a key in encoding map of MediaType object and
42 * MUST exist in a schema as a property.
43 *
44 * @return name of the encoding
45 **/
46 String name() default "";
47
48 /**
49 * The Content-Type for encoding a specific property.
50 *
51 * @return content type of the encoding
52 **/
53 String contentType() default "";
54
55 /**
56 * Describes how a specific property value will be serialized depending on its type
57 *
58 * @return style of the encoding
59 **/
60 String style() default "";
61
62 /**
63 * When this is true, property values of type array or object generate separate parameters for each value of the array,
64 * or key-value-pair of the map.
65 *
66 * @return boolean
67 **/
68 boolean explode() default false;
69
70 /**
71 * Determines whether the parameter value SHOULD allow reserved characters,
72 * as defined by RFC3986 to be included without percent-encoding.
73 *
74 * @return boolean
75 **/
76 boolean allowReserved() default false;
77
78 /**
79 * An array of header objects
80 *
81 * @return array of headers
82 */
83 Header[] headers() default {};
84
85 /**
86 * The list of optional extensions
87 *
88 * @return an optional array of extensions
89 */
90 Extension[] extensions() default {};
91
92 }
93