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

io.muserver.rest.ApiResponse Maven / Gradle / Ivy

There is a newer version: 2.0.3
Show newest version
package io.muserver.rest;

import java.lang.annotation.*;

/**
 * 

Describes a response code and description for an API method, for documentation purposes.

*

Multiple annotations can be added to cover multiple response types.

* @see ApiResponses */ @Target({ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) @Repeatable(ApiResponses.class) public @interface ApiResponse { /** * The HTTP status code of the response. This is a String to allow values such as "2XX" to cover all 200-299 codes. * @return The code */ String code(); /** * A short description of the response. * CommonMark syntax MAY be used for rich text representation. * @return The description */ String message(); /** * A list of possible headers provided alongside the response. * * @return a list of response headers. */ ResponseHeader[] responseHeaders() default {}; /** * The type of the response body. * @return The type */ Class response() default Void.class; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy