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