All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.oneandone.neberus.annotation.ApiResponse Maven / Gradle / Ivy

There is a newer version: 4.2.1
Show newest version
package net.oneandone.neberus.annotation;

import net.oneandone.neberus.ResponseType;
import net.oneandone.neberus.model.ApiStatus;

import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Document a Response that does not fit into Success-, Warning-, or Problem-Response.
 */
@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Repeatable(ApiResponses.class)
public @interface ApiResponse {

    ApiStatus status();

    /**
     * Set the class of the DTO used for the response entity. Currently only the first level in a hierarchy will be printed.
     *
     * @return the entity class
     */
    Class entityClass() default Void.class;

    /**
     * If an entityClass is set and this value is unset, the first Content-Type defined in the @Produces annotation will
     * be used.
     *
     * @return the content type
     */
    String contentType() default "";

    String description() default "";

    ApiHeader[] headers() default {};

    /**
     * Define the type of the response.
     *
     * @return the response type
     */
    ResponseType responseType();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy