yahehe / Nancy.Swagger

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

Ignore some public Model properties. #150

Closed vincentparrett closed 6 years ago

vincentparrett commented 6 years ago

Using Nancy.Swagger.Annotations, there doesn't seem to be a way to ignore any public properties that might be listed on the model class but not part of the public model interface.

A simple solution would be to add an Ignore bool property to the ModelPropertyAttribute, and check that when selecting properties from the type. Properties should probably also be ignored if they have JsonIgnore or XmlIgnore attributes.

I'm happy to submit a pull request to implement this.

jnallard commented 6 years ago

Sounds good to me. Feel free to implement!

vincentparrett commented 6 years ago

Ok, will look into it.

yahehe commented 6 years ago

Implemented by #152