ApiModel
ApiModel copied to clipboard
Make Namespace Optional for Request and/or Response
At this moment the use of namespace on model is mandatory. In addition, the namespace is shared between both request and response. It can happen that in some cases you don't want to wrap request or response
Lets say that you make a request with json presented bellow
{
"user": {
"email": "[email protected]",
"password": "Password1"
}
}
the expected response is parsed to object only if it is wrapped in the same namespace
{
"user": {
"id": 1,
"email": "[email protected]"
}
}
desired behavior would work also with the following response
{
"id": 1,
"email": "[email protected]"
}
The same thing is valid for unwrapped requests.