-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support DescriptionAttribute and ReadOnlyAttribute #3162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support DescriptionAttribute and ReadOnlyAttribute #3162
Conversation
IIRC, it's typically used to provide non-code text for UI elements for code members. For example: [DisplayName("First name")]
public string FirstName { get; set; } I've seen them commonly used to for the Visual Studio designer. For example, this code renders how property windows like the one below Visual Studio. |
src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/OpenApiSchemaExtensions.cs
Outdated
Show resolved
Hide resolved
test/Swashbuckle.AspNetCore.Newtonsoft.Test/SchemaGenerator/NewtonsoftSchemaGeneratorTests.cs
Outdated
Show resolved
Hide resolved
I do not see the need for integrating this attribute, because there is already integrated by the serializers the JsonPropertyName and for Query/Path variables you can put the name of the parameter overriding the name of the object like what we do here:
|
contributes #1954
I do not really know what is intended with DisplayName attribute, but I am sure someone can give me advice in what to do with that attribute