Starting in v6.4, DTO properties with an ApiMemberAttribute
added at runtime via PropertyInfo.AddAttributes
are not displaying the attribute’s Description property in the metadata page or code.
Using the blank .NET 6 template, adding
typeof(Hello)
.GetProperty("Name")
.AddAttributes(
new ApiMemberAttribute
{
ParameterType = "path",
Name = "MetaName",
DataType = "foo",
Description = "The name of the person to say hello to.",
IsRequired = true,
},
new DataMemberAttribute());
results in the description being displayed in metadata in v6.3 and below:
However, starting with v6.4, the description is no longer displayed - although other attributes such as datatype, IsRequired, etc., as well as a dynamically added DataMemberAttributes, are.
Annotating the property itself in code still works; see HelloResponse
.
Example at https://github.com/EricMunn/AddAttributesError
Thanks!