public class ArgumentsMapperCommon extends Object implements ArgumentsMapper
| Constructor and Description |
|---|
ArgumentsMapperCommon(List<ArgumentMapper> mappers) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
invocationArgumentToSwaggerArguments(SwaggerInvocation swaggerInvocation,
Map<String,Object> invocationArguments)
for scenes that consumer arguments not same to contract arguments, eg:
1.consumer: int add(QueryWrapper query)
class QueryWrapper {
public int x;
public int y;
}
contract: int add(int x, int y)
2.consumer: int add(InvocationContext context, int x, int y);
contract: int add(int x, int y)
3.consumer: int add(int x, int y)
contract: int add(BodyRequest body)
class BodyRequest {
public int x;
public int y;
}
notice:
no convert logic when map arguments
map arguments by name, DO NOT use duplicated contract argument names
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitswaggerArgumentToInvocationArgumentspublic ArgumentsMapperCommon(List<ArgumentMapper> mappers)
public Map<String,Object> invocationArgumentToSwaggerArguments(SwaggerInvocation swaggerInvocation, Map<String,Object> invocationArguments)
ArgumentsMapper
for scenes that consumer arguments not same to contract arguments, eg:
1.consumer: int add(QueryWrapper query)
class QueryWrapper {
public int x;
public int y;
}
contract: int add(int x, int y)
2.consumer: int add(InvocationContext context, int x, int y);
contract: int add(int x, int y)
3.consumer: int add(int x, int y)
contract: int add(BodyRequest body)
class BodyRequest {
public int x;
public int y;
}
notice:
no convert logic when map arguments
map arguments by name, DO NOT use duplicated contract argument names
invocationArgumentToSwaggerArguments in interface ArgumentsMapperCopyright © 2017–2020 The Apache Software Foundation. All rights reserved.