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.marshall.oapi;
018
019import static java.lang.annotation.ElementType.*;
020import static java.lang.annotation.RetentionPolicy.*;
021
022import java.lang.annotation.*;
023
024import org.apache.juneau.marshall.*;
025import org.apache.juneau.marshall.msgpack.*;
026
027/**
028 * Annotation for specifying config properties defined in {@link MsgPackSerializer} and {@link MsgPackParser}.
029 *
030 * <p>
031 * Used primarily for specifying bean configuration properties on REST classes and methods.
032 *
033 * <h5 class='section'>See Also:</h5><ul>
034 *    <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/OpenApiSupport">OpenApi</a>
035 * </ul>
036 */
037@Target({ TYPE, METHOD })
038@Retention(RUNTIME)
039@Inherited
040@ContextApply({ OpenApiConfigAnnotation.SerializerApply.class, OpenApiConfigAnnotation.ParserApply.class })
041public @interface OpenApiConfig {
042
043   /**
044    * Default collection format for HTTP parts.
045    *
046    * <p>
047    * Specifies the collection format to use for HTTP parts when not otherwise specified via {@code Schema.collectionFormat()}.
048    *
049    * <ul class='values javatree'>
050    *    <li class='jc'>{@code HttpPartCollectionFormat}
051    *    <ul>
052    *       <li class='jf'>{@code CSV} - (default) Comma-separated values (e.g. <js>"foo,bar"</js>).
053    *       <li class='jf'>{@code SSV} - Space-separated values (e.g. <js>"foo bar"</js>).
054    *       <li class='jf'>{@code TSV} - Tab-separated values (e.g. <js>"foo\tbar"</js>).
055    *       <li class='jf'>{@code PIPES} - Pipe-separated values (e.g. <js>"foo|bar"</js>).
056    *       <li class='jf'>{@code MULTI} - Corresponds to multiple parameter instances instead of multiple values for a single instance (e.g. <js>"foo=bar&amp;foo=baz"</js>).
057    *       <li class='jf'>{@code UONC} - UON collection notation (e.g. <js>"@(foo,bar)"</js>).
058    *    </ul>
059    * </ul>
060    *
061    * <h5 class='section'>See Also:</h5><ul>
062    *    <li class='jm'>{@link OpenApiSerializer.Builder#collectionFormat(HttpPartCollectionFormat)}
063    *    <li class='jm'>{@link OpenApiParser.Builder#collectionFormat(HttpPartCollectionFormat)}
064    * </ul>
065    *
066    * @return The annotation value.
067    */
068   String collectionFormat() default "";
069
070   /**
071    * Default format for HTTP parts.
072    *
073    * <p>
074    * Specifies the format to use for HTTP parts when not otherwise specified via {@code Schema.format()}.
075    *
076    * <ul class='values javatree'>
077    *    <li class='jc'>{@code HttpPartFormat}
078    *    <ul>
079    *       <li class='jf'>{@code UON} - UON notation (e.g. <js>"'foo bar'"</js>).
080    *       <li class='jf'>{@code INT32} - Signed 32 bits.
081    *       <li class='jf'>{@code INT64} - Signed 64 bits.
082    *       <li class='jf'>{@code FLOAT} - 32-bit floating point number.
083    *       <li class='jf'>{@code DOUBLE} - 64-bit floating point number.
084    *       <li class='jf'>{@code BYTE} - BASE-64 encoded characters.
085    *       <li class='jf'>{@code BINARY} - Hexadecimal encoded octets (e.g. <js>"00FF"</js>).
086    *       <li class='jf'>{@code BINARY_SPACED} - Spaced-separated hexadecimal encoded octets (e.g. <js>"00 FF"</js>).
087    *       <li class='jf'>{@code DATE} - An <a href='http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14'>RFC3339 full-date</a>.
088    *       <li class='jf'>{@code DATE_TIME} - An <a href='http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14'>RFC3339 date-time</a>.
089    *       <li class='jf'>{@code PASSWORD} - Used to hint UIs the input needs to be obscured.
090    *       <li class='jf'>{@code NO_FORMAT} - (default) Not specified.
091    *    </ul>
092    * </ul>
093    *
094    * <h5 class='section'>See Also:</h5><ul>
095    *    <li class='jm'>{@link OpenApiSerializer.Builder#format(HttpPartFormat)}
096    *    <li class='jm'>{@link OpenApiParser.Builder#format(HttpPartFormat)}
097    * </ul>
098    *
099    * @return The annotation value.
100    */
101   String format() default "";
102
103   /**
104    * Optional rank for this config.
105    *
106    * <p>
107    * Can be used to override default ordering and application of config annotations.
108    *
109    * @return The annotation value.
110    */
111   int rank() default 0;
112}