Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-cloud-netflix
Commits
62d340bc
Commit
62d340bc
authored
Jan 15, 2016
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support @AliasFor annotation elements in Feign.
fixes gh-766
parent
9287e66c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
SpringMvcContract.java
...mework/cloud/netflix/feign/support/SpringMvcContract.java
+6
-5
SpringMvcContractTest.java
...rk/cloud/netflix/feign/support/SpringMvcContractTest.java
+1
-1
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/support/SpringMvcContract.java
View file @
62d340bc
...
...
@@ -33,12 +33,13 @@ import org.springframework.cloud.netflix.feign.annotation.RequestParamParameterP
import
org.springframework.util.Assert
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
static
feign
.
Util
.
checkState
;
import
static
feign
.
Util
.
emptyToNull
;
import
feign.Contract
;
import
feign.MethodMetadata
;
import
static
feign
.
Util
.
checkState
;
import
static
feign
.
Util
.
emptyToNull
;
import
static
org
.
springframework
.
core
.
annotation
.
AnnotatedElementUtils
.
findMergedAnnotation
;
/**
* @author Spencer Gibb
*/
...
...
@@ -73,7 +74,7 @@ public class SpringMvcContract extends Contract.BaseContract {
public
MethodMetadata
parseAndValidateMetadata
(
Class
<?>
targetType
,
Method
method
)
{
MethodMetadata
md
=
super
.
parseAndValidateMetadata
(
targetType
,
method
);
RequestMapping
classAnnotation
=
targetType
.
getAnnotation
(
RequestMapping
.
class
);
RequestMapping
classAnnotation
=
findMergedAnnotation
(
targetType
,
RequestMapping
.
class
);
if
(
classAnnotation
!=
null
)
{
// Prepend path from class annotation if specified
if
(
classAnnotation
.
value
().
length
>
0
)
{
...
...
@@ -111,7 +112,7 @@ public class SpringMvcContract extends Contract.BaseContract {
return
;
}
RequestMapping
methodMapping
=
RequestMapping
.
class
.
cast
(
methodAnnotation
);
RequestMapping
methodMapping
=
findMergedAnnotation
(
method
,
RequestMapping
.
class
);
// HTTP Method
checkOne
(
method
,
methodMapping
.
method
(),
"method"
);
data
.
template
().
method
(
methodMapping
.
method
()[
0
].
name
());
...
...
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/feign/support/SpringMvcContractTest.java
View file @
62d340bc
...
...
@@ -162,7 +162,7 @@ public class SpringMvcContractTest {
public
interface
TestTemplate_Advanced
{
@ExceptionHandler
@RequestMapping
(
value
=
"/test/{id}"
,
method
=
RequestMethod
.
PUT
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
@RequestMapping
(
path
=
"/test/{id}"
,
method
=
RequestMethod
.
PUT
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
ResponseEntity
<
TestObject
>
getTest
(
@RequestHeader
(
"Authorization"
)
String
auth
,
@PathVariable
(
"id"
)
String
id
,
@RequestParam
(
"amount"
)
Integer
amount
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment