I use the Swashbuckle package, which integrates swagger with a Web API project. I want to hide a property marked as Ignored in the documentation. I tried to use different methods like IgnoreDataMember, DataContract and DataMember, JsonIgnore or XmlIgnore, but nothing works with swagger ui.
However, in the default API documentation, it works as expected. This is what my model looks like:
public partial class Model : BaseSettingsModel
{
public string ReceiptTitle { get; set; }
[IgnoreDataMember]
public FieldsEnum Fields { get; set; }
public string DisplayFields { get; set; }
}
source
share