-
-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Controller advice documents ApiResponse on every operation, even if t…
…he operation does not annotate the exception to be thrown. Fixes #2483
- Loading branch information
1 parent
534080f
commit cb3b772
Showing
12 changed files
with
227 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
...gdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAdviceInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
/* | ||
* | ||
* * | ||
* * * | ||
* * * * | ||
* * * * * Copyright 2019-2022 the original author or authors. | ||
* * * * * | ||
* * * * * 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 | ||
* * * * * | ||
* * * * * https://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 org.springdoc.core.models; | ||
|
||
import java.lang.reflect.Method; | ||
import java.util.Set; | ||
|
||
import io.swagger.v3.oas.models.responses.ApiResponses; | ||
|
||
/** | ||
* The type Method advice info. | ||
* | ||
* @author bnasslahsen | ||
*/ | ||
public class MethodAdviceInfo { | ||
|
||
/** | ||
* The Method. | ||
*/ | ||
private final Method method; | ||
|
||
/** | ||
* The Exceptions. | ||
*/ | ||
private Set<Class<?>> exceptions; | ||
|
||
/** | ||
* The Api responses. | ||
*/ | ||
private ApiResponses apiResponses; | ||
|
||
/** | ||
* Instantiates a new Method advice info. | ||
* | ||
* @param method the method | ||
*/ | ||
public MethodAdviceInfo(Method method) { | ||
this.method = method; | ||
} | ||
|
||
/** | ||
* Gets method. | ||
* | ||
* @return the method | ||
*/ | ||
public Method getMethod() { | ||
return method; | ||
} | ||
|
||
/** | ||
* Gets exceptions. | ||
* | ||
* @return the exceptions | ||
*/ | ||
public Set<Class<?>> getExceptions() { | ||
return exceptions; | ||
} | ||
|
||
/** | ||
* Sets exceptions. | ||
* | ||
* @param exceptions the exceptions | ||
*/ | ||
public void setExceptions(Set<Class<?>> exceptions) { | ||
this.exceptions = exceptions; | ||
} | ||
|
||
/** | ||
* Gets api responses. | ||
* | ||
* @return the api responses | ||
*/ | ||
public ApiResponses getApiResponses() { | ||
return apiResponses; | ||
} | ||
|
||
/** | ||
* Sets api responses. | ||
* | ||
* @param apiResponses the api responses | ||
*/ | ||
public void setApiResponses(ApiResponses apiResponses) { | ||
this.apiResponses = apiResponses; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.