ApiModel icon indicating copy to clipboard operation
ApiModel copied to clipboard

Make Namespace Optional for Request and/or Response

Open dkocic opened this issue 9 years ago • 0 comments

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.

dkocic avatar Apr 29 '16 08:04 dkocic