Skip to content

Add support for documenting the response #16

Open
ghost opened this Issue Feb 1, 2012 · 9 comments

7 participants

@ghost
ghost commented Feb 1, 2012

Most responses are quite self explanatory, however it would be useful if (some parts of) the response could be annotated with an explanation.

@gggeek
gggeek commented Aug 26, 2012

+1

@brianr
brianr commented Sep 25, 2012

+1. Anyone know of any good examples to model after?

@challgren

+1

@allenhuang

+1. I think 'parameters' will be a good start. But it needs more tuning..

@challgren

Also allowing a min and max value along with a regex would be helpful maybe I'll write a patch real quick

@allenhuang

Hi,

I implemented a way to annotate the format and schema of response.
It needs to add a ExpectResponses key in method.
The structure is as following:

{
  "methods":[
    {
      "parameters": [...],
      "ExpectResponses": [
        {
          "Format": "json",
          "Schema": { ... }
        }
      ]
    }
  ]
}

You can use json schema to annotate the json response in "Schema".
And maybe later use the schema to do some validations.(I've noticed @dgc-wh implemented JSV in his branch)

The output is just like headers as followings:
screenshot

Details see #50.

@phairow
phairow commented Oct 9, 2014

response schemas make a lot of sense and current support for schemas exists but only for the request and only for json requests in particular (this drives the form based input where only text areas were available before). I closed #50 and added comments on where response schemas will probably end up. this feature is important and also should incorporate support for xml or other serialization formats.

@steinbachr

+1

@theHound9987

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.