danieleli / Swagger.Net

Library to document the ASP.NET Web API using the Swagger specification
http://danieleli.github.com/Swagger.Net/
13 stars 3 forks source link

Primitive types do not align with swagger specification names #10

Open geoffreys opened 11 years ago

geoffreys commented 11 years ago

Data types defined in models and arguments do not align with Swagger types and are therefore not cross platform compatible when used with Swagger Code-Gen.

For example, returns Int32 instead of int. The list of 'standard' swagger types is defined at https://github.com/wordnik/swagger-core/wiki/Datatypes

geoffreys commented 11 years ago

An example from the swagger generated by the included sample project:

{"apiVersion":"0.6.1.0","swaggerVersion":"2.0","basePath":"http://localhost:2961",
 "resourcePath":"Values","description":"","apis":[{"path":"/api/Values","description":"","operations"  
  [{"httpMethod":"GET","nickname":"Get","responseClass":"String","summary":"","notes":"",
  "parameters":[],"errorResponses":[]}]},{"path":"/api/Values/{id}","description":"","operations"
  [{"httpMethod":"GET","nickname":"Get","responseClass":"String","summary":"","notes":"","parameters
 [{"paramType":"path","name":"id","description":"","dataType":"Int32","required":true,"allowMultiple":false}],
 "errorResponses":[]}]}],"models":{}}

dataType: Int32 should be dataType: int