yahehe / Nancy.Swagger

Nancy plugin for generated API documentation in Swagger format.
MIT License
133 stars 60 forks source link

Description missing in swagger 'property' schema #116

Closed DGuidi closed 7 years ago

DGuidi commented 7 years ago

Looks that in GenerateSchemaForProperty method Description is ignored.

private static Schema GenerateSchemaForProperty(ModelProperty property)
{
  Schema schema = new Schema();
  schema.Type = property.Type?.ToCamelCase();
  schema.Description = property.Description; // this is correct?
  // other stuff
}

I've checked swagger specifications and looks that it's valid to specify a description for a property. Or am I missing something?

jnallard commented 7 years ago

Yeah, a lot of things are probably overlooked. The Schema class has a Description property, so ignoring it wasn't intentional!

Feel free to make a PR! Otherwise we'll get this later.

Edit: And sorry for the late response. I guess I missed this earlier

DGuidi commented 7 years ago

no probs I've forked the repo but I've made some changes external to specific issue, so feel free to fix when you have time