|
1 | 1 | /** |
2 | | - * Copyright 2015 SmartBear Software |
3 | | - * |
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 | | - * |
8 | | - * http://www.apache.org/licenses/LICENSE-2.0 |
9 | | - * |
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. |
| 2 | + * Copyright 2015 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 | 15 | */ |
16 | 16 |
|
17 | 17 | package io.swagger.annotations; |
18 | 18 |
|
19 | | -import java.lang.annotation.*; |
| 19 | +import java.lang.annotation.ElementType; |
| 20 | +import java.lang.annotation.Inherited; |
| 21 | +import java.lang.annotation.Retention; |
| 22 | +import java.lang.annotation.RetentionPolicy; |
| 23 | +import java.lang.annotation.Target; |
20 | 24 |
|
21 | 25 |
|
22 | 26 | /** |
|
30 | 34 | @Retention(RetentionPolicy.RUNTIME) |
31 | 35 | @Inherited |
32 | 36 | public @interface Api { |
33 | | - /** |
34 | | - * Implicitly sets a tag for the operations, legacy support (read description). |
35 | | - * <p> |
36 | | - * In swagger-core 1.3.X, this was used as the 'path' that is to host the API Declaration of the |
37 | | - * resource. This is no longer relevant in swagger-core 1.5.X. |
38 | | - * <p> |
39 | | - * If {@link #tags()} is <i>not</i> used, this value will be used to set the tag for the operations described by this |
40 | | - * resource. Otherwise, the value will be ignored. |
41 | | - * <p> |
42 | | - * The leading / (if exists) will be removed. |
43 | | - * |
44 | | - * @return tag name for operations under this resource, unless {@link #tags()} is defined. |
45 | | - */ |
46 | | - String value() default ""; |
| 37 | + /** |
| 38 | + * Implicitly sets a tag for the operations, legacy support (read description). |
| 39 | + * <p> |
| 40 | + * In swagger-core 1.3.X, this was used as the 'path' that is to host the API Declaration of the |
| 41 | + * resource. This is no longer relevant in swagger-core 1.5.X. |
| 42 | + * <p> |
| 43 | + * If {@link #tags()} is <i>not</i> used, this value will be used to set the tag for the operations described by this |
| 44 | + * resource. Otherwise, the value will be ignored. |
| 45 | + * <p> |
| 46 | + * The leading / (if exists) will be removed. |
| 47 | + * |
| 48 | + * @return tag name for operations under this resource, unless {@link #tags()} is defined. |
| 49 | + */ |
| 50 | + String value() default ""; |
47 | 51 |
|
48 | | - /** |
49 | | - * A list of tags for API documentation control. |
50 | | - * Tags can be used for logical grouping of operations by resources or any other qualifier. |
51 | | - * <p> |
52 | | - * A non-empty value will override the value provided in {@link #value()}. |
53 | | - * |
54 | | - * @since 1.5.2-M1 |
55 | | - * |
56 | | - * @return a string array of tag values |
57 | | - */ |
58 | | - String[] tags() default ""; |
| 52 | + /** |
| 53 | + * A list of tags for API documentation control. |
| 54 | + * Tags can be used for logical grouping of operations by resources or any other qualifier. |
| 55 | + * <p> |
| 56 | + * A non-empty value will override the value provided in {@link #value()}. |
| 57 | + * |
| 58 | + * @since 1.5.2-M1 |
| 59 | + * |
| 60 | + * @return a string array of tag values |
| 61 | + */ |
| 62 | + String[] tags() default ""; |
59 | 63 |
|
60 | | - /** |
61 | | - * Not used in 1.5.X, kept for legacy support. |
62 | | - * |
63 | | - * @return a longer description about this API, no longer used. |
64 | | - */ |
65 | | - @Deprecated |
66 | | - String description() default ""; |
| 64 | + /** |
| 65 | + * Not used in 1.5.X, kept for legacy support. |
| 66 | + * |
| 67 | + * @return a longer description about this API, no longer used. |
| 68 | + */ |
| 69 | + @Deprecated String description() default ""; |
67 | 70 |
|
68 | | - /** |
69 | | - * Not used in 1.5.X, kept for legacy support. |
70 | | - * |
71 | | - * @return the basePath for this operation, no longer used. |
72 | | - */ |
73 | | - @Deprecated |
74 | | - String basePath() default ""; |
| 71 | + /** |
| 72 | + * Not used in 1.5.X, kept for legacy support. |
| 73 | + * |
| 74 | + * @return the basePath for this operation, no longer used. |
| 75 | + */ |
| 76 | + @Deprecated String basePath() default ""; |
75 | 77 |
|
76 | | - /** |
77 | | - * Not used in 1.5.X, kept for legacy support. |
78 | | - * |
79 | | - * @return the position of this API in the resource listing, no longer used. |
80 | | - */ |
81 | | - @Deprecated |
82 | | - int position() default 0; |
| 78 | + /** |
| 79 | + * Not used in 1.5.X, kept for legacy support. |
| 80 | + * |
| 81 | + * @return the position of this API in the resource listing, no longer used. |
| 82 | + */ |
| 83 | + @Deprecated int position() default 0; |
83 | 84 |
|
84 | | - /** |
85 | | - * Corresponds to the `produces` field of the operations under this resource. |
86 | | - * <p> |
87 | | - * Takes in comma-separated values of content types. |
88 | | - * For example, "application/json, application/xml" would suggest the operations |
89 | | - * generate JSON and XML output. |
90 | | - * <p> |
91 | | - * For JAX-RS resources, this would automatically take the value of the {@code @Produces} |
92 | | - * annotation if such exists. It can also be used to override the {@code @Produces} values |
93 | | - * for the Swagger documentation. |
94 | | - * |
95 | | - * @return the supported media types supported by the server, or an empty string if not set. |
96 | | - */ |
97 | | - String produces() default ""; |
| 85 | + /** |
| 86 | + * Corresponds to the `produces` field of the operations under this resource. |
| 87 | + * <p> |
| 88 | + * Takes in comma-separated values of content types. |
| 89 | + * For example, "application/json, application/xml" would suggest the operations |
| 90 | + * generate JSON and XML output. |
| 91 | + * <p> |
| 92 | + * For JAX-RS resources, this would automatically take the value of the {@code @Produces} |
| 93 | + * annotation if such exists. It can also be used to override the {@code @Produces} values |
| 94 | + * for the Swagger documentation. |
| 95 | + * |
| 96 | + * @return the supported media types supported by the server, or an empty string if not set. |
| 97 | + */ |
| 98 | + String produces() default ""; |
98 | 99 |
|
99 | | - /** |
100 | | - * Corresponds to the `consumes` field of the operations under this resource. |
101 | | - * <p> |
102 | | - * Takes in comma-separated values of content types. |
103 | | - * For example, "application/json, application/xml" would suggest the operations |
104 | | - * accept JSON and XML input. |
105 | | - * <p> |
106 | | - * For JAX-RS resources, this would automatically take the value of the {@code @Consumes} |
107 | | - * annotation if such exists. It can also be used to override the {@code @Consumes} values |
108 | | - * for the Swagger documentation. |
109 | | - * |
110 | | - * @return the consumes value, or empty string if not set |
111 | | - */ |
112 | | - String consumes() default ""; |
| 100 | + /** |
| 101 | + * Corresponds to the `consumes` field of the operations under this resource. |
| 102 | + * <p> |
| 103 | + * Takes in comma-separated values of content types. |
| 104 | + * For example, "application/json, application/xml" would suggest the operations |
| 105 | + * accept JSON and XML input. |
| 106 | + * <p> |
| 107 | + * For JAX-RS resources, this would automatically take the value of the {@code @Consumes} |
| 108 | + * annotation if such exists. It can also be used to override the {@code @Consumes} values |
| 109 | + * for the Swagger documentation. |
| 110 | + * |
| 111 | + * @return the consumes value, or empty string if not set |
| 112 | + */ |
| 113 | + String consumes() default ""; |
113 | 114 |
|
114 | | - /** |
115 | | - * Sets specific protocols (schemes) for the operations under this resource. |
116 | | - * <p> |
117 | | - * Comma-separated values of the available protocols. Possible values: http, https, ws, wss. |
118 | | - * |
119 | | - * @return the protocols supported by the operations under the resource. |
120 | | - */ |
121 | | - String protocols() default ""; |
| 115 | + /** |
| 116 | + * Sets specific protocols (schemes) for the operations under this resource. |
| 117 | + * <p> |
| 118 | + * Comma-separated values of the available protocols. Possible values: http, https, ws, wss. |
| 119 | + * |
| 120 | + * @return the protocols supported by the operations under the resource. |
| 121 | + */ |
| 122 | + String protocols() default ""; |
122 | 123 |
|
123 | | - /** |
124 | | - * Corresponds to the `security` field of the Operation Object. |
125 | | - * <p> |
126 | | - * Takes in a list of the authorizations (security requirements) for the operations under this resource. |
127 | | - * This may be overridden by specific operations. |
128 | | - * |
129 | | - * @see Authorization |
130 | | - * |
131 | | - * @return an array of authorizations required by the server, or a single, empty authorization value if not set. |
132 | | - */ |
133 | | - Authorization[] authorizations() default @Authorization(value = ""); |
| 124 | + /** |
| 125 | + * Corresponds to the `security` field of the Operation Object. |
| 126 | + * <p> |
| 127 | + * Takes in a list of the authorizations (security requirements) for the operations under this resource. |
| 128 | + * This may be overridden by specific operations. |
| 129 | + * |
| 130 | + * @see Authorization |
| 131 | + * |
| 132 | + * @return an array of authorizations required by the server, or a single, empty authorization value if not set. |
| 133 | + */ |
| 134 | + Authorization[] authorizations() default @Authorization(value = ""); |
134 | 135 |
|
135 | | - /** |
136 | | - * Hides the operations under this resource. |
137 | | - * |
138 | | - * @return true if the api should be hidden from the swagger documentation |
139 | | - */ |
140 | | - boolean hidden() default false; |
| 136 | + /** |
| 137 | + * Hides the operations under this resource. |
| 138 | + * |
| 139 | + * @return true if the api should be hidden from the swagger documentation |
| 140 | + */ |
| 141 | + boolean hidden() default false; |
141 | 142 | } |
0 commit comments