I am struggling with the same problem, but realized that this feature is not currently supported. You cannot receive POST or PUT data using models. This feature is on the move and in development, so I think it is on the task list.
If you look at the source code, you will see that the Models property is missing in the ResourceResponse :
[DataContract] public class ResourcesResponse { [DataMember(Name = "swaggerVersion")] public string SwaggerVersion { get; set; } [DataMember(Name = "apiVersion")] public string ApiVersion { get; set; } [DataMember(Name = "basePath")] public string BasePath { get; set; } [DataMember(Name = "apis")] public List<RestService> Apis { get; set; } }
If you compare this with the Petstore example in Wordnik, you will find that the models are included as the root node:
{ "apiVersion":"0.2", "swaggerVersion":"1.1", "basePath":"http://petstore.swagger.wordnik.com/api", "resourcePath":"/pet", "apis":[ { "path":"/pet.{format}", "description":"Operations about pets", "operations":[ { "httpMethod":"POST", "summary":"Add a new pet to the store", "responseClass":"void", "nickname":"addPet", "parameters":[ { "description":"Pet object that needs to be added to the store", "paramType":"body", "required":true, "allowMultiple":false, "dataType":"Pet" } ], "errorResponses":[ { "code":405, "reason":"Invalid input" } ] } ] } ], "models":{ "Category":{ "id":"Category", "properties":{ "id":{ "type":"long" }, "name":{ "type":"string" } } }, "Pet":{ "id":"Pet", "properties":{ "tags":{ "items":{ "$ref":"Tag" }, "type":"Array" }, "id":{ "type":"long" }, "category":{ "type":"Category" }, "status":{ "allowableValues":{ "valueType":"LIST", "values":[ "available", "pending", "sold" ], "valueType":"LIST" }, "description":"pet status in the store", "type":"string" }, "name":{ "type":"string" }, "photoUrls":{ "items":{ "type":"string" }, "type":"Array" } } }, "Tag":{ "id":"Tag", "properties":{ "id":{ "type":"long" }, "name":{ "type":"string" } } } } }
I think the only way around this is by itself. Have a request object that accepts an entire object, such as Pet. Set ParameterType to body and DataType to Pet . In the Swagger interface, you will see a text field into which you must insert the actual JSON object. You will request the following:
[Api("The Thing Service")] [Route("/thing", "POST", Summary = @"POST a new thing", Notes = "Send a thing here")] public class ThingRequest { [DataMember] [ApiMember(Name = "Thing", Description = "The thing", ParameterType = "body", DataType = "Thing", IsRequired = false)] public ThingDto Thing { get; set; } }
And your service:
/// <summary> /// Summary description for ThingService /// </summary> public class ThingService : Service { public IThingRepository ThingRepository { get; set; } public object Post(ThingRequest request) { var thing = Thing.Map(request); ThingRepository.Save(thing); return new ThingResponse(); } }
The following will be shown:

Enter such an object and the request will be parsed correctly:
