z0mt3c / hapi-swaggered

Yet another hapi plugin providing swagger compliant API specifications based on routes and joi schemas to be used with swagger-ui.
MIT License
82 stars 38 forks source link

Array responses not display in swagger-ui #10

Closed z0mt3c closed 9 years ago

z0mt3c commented 9 years ago

hapi-swaggered: 2.0.0-alpha2 swagger-ui: 2.1.8-M1

{
    "tags": ["api", "jobs"],
    "summary": "List resources",
    "description": "List resources",
    "responses": {
        "default": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/Job"
            }
        }
    },
    "produces": ["application/json"]
}

Whats the correct shema? May swagger-ui issue? @z0mt3c: Have a look :-)

Btw - no issue about the referenced schema - following works great:

"responses": {
    "default": {
        "schema": {
            "$ref": "#/definitions/Job"
        }
    }
}
z0mt3c commented 9 years ago

Not an issue of swagger-ui... correct would be:

{
    "tags": ["api", "jobs"],
    "summary": "List resources",
    "description": "List resources",
    "responses": {
        "default": {
            "schema": {
              "type": "array",
              "items": {
                  "$ref": "#/definitions/Job"
              }
           }
        }
    },
    "produces": ["application/json"]
}
z0mt3c commented 9 years ago

v2.0.0-alpha.3