Skip to content

Need to configure JSON envelope #44

Description

@snebjorn

Currently responses are wrapped in a value envelope

  "responses": {
    "200": {
      "description": "List of Foo",
      "schema": {
        "type": "object",
        "properties": {
          "value": {
            "type": "array",
            "items": {
              "$ref": "#/definitions/Foo"
            }
          }
        }
      }
    }
  }

However I'm consuming an OData endpoint that for some reason wraps it in d.results.

So it would be nice if I could define this in the options and get this generated

{
  "swagger": "2.0",
  // ...omitted
  "paths": {
    "/FooSet": {
      "get": {
        "operationId": "getFooSet",
        "responses": {
          "200": {
            "description": "List of Foo",
            "schema": {
              "type": "object",
              "properties": {
                "d": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/definitions/Foo"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions