001// ***************************************************************************************************************************
002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *
003// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *
004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *
005// * with the License.  You may obtain a copy of the License at                                                              *
006// *                                                                                                                         *
007// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *
008// *                                                                                                                         *
009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *
010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *
011// * specific language governing permissions and limitations under the License.                                              *
012// ***************************************************************************************************************************
013package org.apache.juneau.annotation;
014
015import static java.lang.annotation.RetentionPolicy.*;
016
017import java.lang.annotation.*;
018
019/**
020 * Swagger items annotation.
021 *
022 * <p>
023 * This class is essentially identical to {@link Items} except it's used for defining items of items.
024 *
025 * <p>
026 * Since annotations cannot be nested, we're forced to create a separate annotation for it.
027 * <br>If you want to nest items further, you have to define them free-form using {@link #items()} as free-form JSON.
028 *
029 * <h5 class='section'>See Also:</h5><ul>
030 *    <li class='link'><a class="doclink" href="../../../../index.html#jd.Swagger">Swagger</a>
031 *    <li class='extlink'><a class="doclink" href="https://swagger.io/specification/v2#itemsObject">Swagger Items Object</a>
032
033 * </ul>
034 */
035@Documented
036@Retention(RUNTIME)
037public @interface SubItems {
038
039   /**
040    * <mk>default</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#itemsObject">Swagger Items Object</a>.
041    *
042    * <h5 class='section'>Notes:</h5><ul>
043    *    <li class='note'>
044    *       The format is a plain-text string.
045    * </ul>
046    *
047    * @return The annotation value.
048    */
049   String[] _default() default {};
050
051   /**
052    * <mk>enum</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#itemsObject">Swagger Items Object</a>.
053    *
054    * <h5 class='section'>Notes:</h5><ul>
055    *    <li class='note'>
056    *       The format is a plain-text string.
057    * </ul>
058    *
059    * @return The annotation value.
060    */
061   String[] _enum() default {};
062
063   /**
064    * <mk>$ref</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#itemsObject">Swagger Items Object</a>.
065    *
066    * <h5 class='section'>Notes:</h5><ul>
067    *    <li class='note'>
068    *       The format is a plain-text string.
069    * </ul>
070    *
071    * @return The annotation value.
072    */
073   String $ref() default "";
074
075   /**
076    * Synonym for {@link #collectionFormat()}.
077    *
078    * @return The annotation value.
079    */
080   String cf() default "";
081
082   /**
083    * <mk>collectionFormat</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#itemsObject">Swagger Items Object</a>.
084    *
085    * <h5 class='section'>Notes:</h5><ul>
086    *    <li class='note'>
087    *       The format is a plain-text string.
088    * </ul>
089    *
090    * @return The annotation value.
091    */
092   String collectionFormat() default "";
093
094   /**
095    * Synonym for {@link #_default()}.
096    *
097    * @return The annotation value.
098    */
099   String[] df() default {};
100
101   /**
102    * Synonym for {@link #_enum()}.
103    *
104    * @return The annotation value.
105    */
106   String[] e() default {};
107
108   /**
109    * Synonym for {@link #exclusiveMaximum()}.
110    *
111    * @return The annotation value.
112    */
113   boolean emax() default false;
114
115   /**
116    * Synonym for {@link #exclusiveMinimum()}.
117    *
118    * @return The annotation value.
119    */
120   boolean emin() default false;
121
122   /**
123    * <mk>exclusiveMaximum</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#itemsObject">Swagger Items Object</a>.
124    *
125    * <h5 class='section'>Notes:</h5><ul>
126    *    <li class='note'>
127    *       The format is a plain-text string.
128    * </ul>
129    *
130    * @return The annotation value.
131    */
132   boolean exclusiveMaximum() default false;
133
134   /**
135    * <mk>exclusiveMinimum</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#itemsObject">Swagger Items Object</a>.
136    *
137    * <h5 class='section'>Notes:</h5><ul>
138    *    <li class='note'>
139    *       The format is a plain-text string.
140    * </ul>
141    *
142    * @return The annotation value.
143    */
144   boolean exclusiveMinimum() default false;
145
146   /**
147    * Synonym for {@link #format()}.
148    *
149    * @return The annotation value.
150    */
151   String f() default "";
152
153   /**
154    * <mk>format</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#itemsObject">Swagger Items Object</a>.
155    *
156    * <h5 class='section'>Notes:</h5><ul>
157    *    <li class='note'>
158    *       The format is a plain-text string.
159    * </ul>
160    *
161    * @return The annotation value.
162    */
163   String format() default "";
164
165   /**
166    * <mk>items</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#itemsObject">Swagger Items Object</a>.
167    *
168    * <p>
169    * Describes the type of items in the array.
170    *
171    * <p>
172    * This is a <a class="doclink" href="../../../../index.html#jd.Swagger">Swagger</a> object.
173    * <br>It must be declared free-form because it's not possible to nest annotations in Java.
174    *
175    * @return The annotation value.
176    */
177   String[] items() default {};
178
179   /**
180    * Synonym for {@link #maximum()}.
181    *
182    * @return The annotation value.
183    */
184   String max() default "";
185
186   /**
187    * Synonym for {@link #maxItems()}.
188    *
189    * @return The annotation value.
190    */
191   long maxi() default -1;
192
193   /**
194    * <mk>maximum</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#itemsObject">Swagger Items Object</a>.
195    *
196    * <h5 class='section'>Notes:</h5><ul>
197    *    <li class='note'>
198    *       The format is a plain-text string.
199    * </ul>
200    *
201    * @return The annotation value.
202    */
203   String maximum() default "";
204
205   /**
206    * <mk>maxItems</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#itemsObject">Swagger Items Object</a>.
207    *
208    * <h5 class='section'>Notes:</h5><ul>
209    *    <li class='note'>
210    *       The format is a plain-text string.
211    * </ul>
212    *
213    * @return The annotation value.
214    */
215   long maxItems() default -1;
216
217   /**
218    * Synonym for {@link #maxLength()}.
219    *
220    * @return The annotation value.
221    */
222   long maxl() default -1;
223
224   /**
225    * <mk>maxLength</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#itemsObject">Swagger Items Object</a>.
226    *
227    * <h5 class='section'>Notes:</h5><ul>
228    *    <li class='note'>
229    *       The format is a plain-text string.
230    * </ul>
231    *
232    * @return The annotation value.
233    */
234   long maxLength() default -1;
235
236   /**
237    * Synonym for {@link #minimum()}.
238    *
239    * @return The annotation value.
240    */
241   String min() default "";
242
243   /**
244    * Synonym for {@link #minItems()}.
245    *
246    * @return The annotation value.
247    */
248   long mini() default -1;
249
250   /**
251    * <mk>minimum</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#itemsObject">Swagger Items Object</a>.
252    *
253    * <h5 class='section'>Notes:</h5><ul>
254    *    <li class='note'>
255    *       The format is a plain-text string.
256    * </ul>
257    *
258    * @return The annotation value.
259    */
260   String minimum() default "";
261
262   /**
263    * <mk>minItems</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#itemsObject">Swagger Items Object</a>.
264    *
265    * <h5 class='section'>Notes:</h5><ul>
266    *    <li class='note'>
267    *       The format is a plain-text string.
268    * </ul>
269    *
270    * @return The annotation value.
271    */
272   long minItems() default -1;
273
274   /**
275    * Synonym for {@link #minLength()}.
276    *
277    * @return The annotation value.
278    */
279   long minl() default -1;
280
281   /**
282    * <mk>minLength</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#itemsObject">Swagger Items Object</a>.
283    *
284    * <h5 class='section'>Notes:</h5><ul>
285    *    <li class='note'>
286    *       The format is a plain-text string.
287    * </ul>
288    *
289    * @return The annotation value.
290    */
291   long minLength() default -1;
292
293   /**
294    * Synonym for {@link #multipleOf()}.
295    *
296    * @return The annotation value.
297    */
298   String mo() default "";
299
300   /**
301    * <mk>multipleOf</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#itemsObject">Swagger Items Object</a>.
302    *
303    * <h5 class='section'>Notes:</h5><ul>
304    *    <li class='note'>
305    *       The format is a plain-text string.
306    * </ul>
307    *
308    * @return The annotation value.
309    */
310   String multipleOf() default "";
311
312   /**
313    * Synonym for {@link #pattern()}.
314    *
315    * @return The annotation value.
316    */
317   String p() default "";
318
319   /**
320    * <mk>pattern</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#itemsObject">Swagger Items Object</a>.
321    *
322    * <h5 class='section'>Notes:</h5><ul>
323    *    <li class='note'>
324    *       The format is a plain-text string.
325    * </ul>
326    *
327    * @return The annotation value.
328    */
329   String pattern() default "";
330
331   /**
332    * Synonym for {@link #type()}.
333    *
334    * @return The annotation value.
335    */
336   String t() default "";
337
338   /**
339    * <mk>type</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#itemsObject">Swagger Items Object</a>.
340    *
341    * <h5 class='section'>Notes:</h5><ul>
342    *    <li class='note'>
343    *       The format is a plain-text string.
344    * </ul>
345    *
346    * @return The annotation value.
347    */
348   String type() default "";
349
350   /**
351    * Synonym for {@link #uniqueItems()}.
352    *
353    * @return The annotation value.
354    */
355   boolean ui() default false;
356
357   /**
358    * <mk>uniqueItems</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#itemsObject">Swagger Items Object</a>.
359    *
360    * <h5 class='section'>Notes:</h5><ul>
361    *    <li class='note'>
362    *       The format is a plain-text string.
363    * </ul>
364    *
365    * @return The annotation value.
366    */
367   boolean uniqueItems() default false;
368}