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

com.wordnik.swagger.annotations.ApiResponse Maven / Gradle / Ivy

There is a newer version: 1.5.3-M1
Show newest version
/**
 *  Copyright 2014 Reverb Technologies, Inc.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package com.wordnik.swagger.annotations;

import java.lang.annotation.*;

/**
 * Describes a possible response of an operation.
 * 

* This can be used to describe possible success and error codes from your REST API call. * You may or may not use this to describe the return type of the operation (normally a * successful code), but the successful response should be described as well using the * {@link ApiOperation}. *

* If your API has uses a different response class for these responses, you can describe them * here by associating a response class with a response code. * Note, Swagger does not allow multiple response types for a single response code. *

* This annotation is not used directly and will not be parsed by Swagger. It should be used * within the {@link ApiResponses}. * * @see ApiOperation * @see ApiResponses */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @Inherited public @interface ApiResponse { /** * The HTTP status code of the response. *

* The value should be one of the formal HTTP Status Code Definitions. */ int code(); /** * Human-readable message to accompany the response. */ String message(); /** * Optional response class to describe the payload of the message. *

* Corresponds to the `responseModel` field of the response message object. */ Class response() default Void.class; }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy