Skip to content

Support multiple example types #70

@WillGunn

Description

@WillGunn

We are using Swashbuckle to generate swagger from a .net project, Given the sample swagger.json file, the example block is not rendered onto the webpage, only the generic schema:

The example block starts at line 30
swagger_example_issue.txt

For easy reference:
"responses": { "200": { "description": "Success", "schema": { "type": "array", "items": { "$ref": "#/definitions/BasicClient" } }, "examples": { "application/json": [ { "userId": "c12cfeef-0001-0010-0100-abb9e51deaf1", "firstName": "Bruce", "lastName": "Wayne", "email": "BWayne@website.moc", "homePhone": "555-555-5551", "cellPhone": "555-555-5550" }, { "userId": "d12cfeef-0001-0010-0100-abb9e51deaf2", "firstName": "George", "lastName": "Washington", "email": "POTUS1@website.moc", "homePhone": "555-555-5553", "cellPhone": "555-555-5552" }, { "userId": "e12cfeef-0001-0010-0100-abb9e51deaf3", "firstName": "George", "lastName": "Washington", "email": "CiC@website.moc", "homePhone": "555-555-5555", "cellPhone": "555-555-5554" } ] } } }
with BasicClient defined as
"BasicClient": { "type": "object", "properties": { "userId": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "email": { "type": "string" }, "homePhone": { "type": "string" }, "cellPhone": { "type": "string" } } }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions