richhollis/swagger-docs — pull request #25 by fotinakis (2014-02-15 22:45:31+00:00)
Title: Add support for Swagger model definitions.

https://github.com/wordnik/swagger-core/wiki/Datatypes#wiki-complex-types

Following the same pattern as `swagger_api`, you simply do:
```ruby
swagger_model :Tag do
description "A Tag object."
property :id, :integer, :required, "User Id"
property :name, :string, :optional, "Name", foo: "test"
end
```

And then the root JSON object will have:
```
"models": {
"id": "Tag",
"required": ["id"],
"description": "A Tag object.",
"properties": {
"name": {
"type": "string",
"description": "Name",
"foo": "test",
},
"id": {
"type": "integer",
"description": "User Id",
}
}
}
```