I've read here about additional information of web API help page. The data annotation actually provides the additional information for documentation. But I want to know that is there anyway to provide additional information without data annotations?
If yes then how?
If not then is there anyway to override the additional information with data annotations for instance the
[Required]
shows Required written in additional information but what if I want to show "This field is required" or something like that?
Thanks
EDIT see in picture I want to update that additional information without data annotation if possible.
If you want to give custom additional information(using data annotation) then @Pedro G. Dias's answer is your solution but if you want to give additional information without using data annotation then I am afraid that it is not possible OR you have to use some alternative procedure to do so as commented by @DynamicVariable on your question.
PS. I've debugged documentation project to check and I found that addition information is actually provided by data annotations.
You can edit the
Required Attribute
in theModelDescriptionGenerator.cs
Areas>HelpPage>ModelDescriptions>ModelDescriptionGenerator.cs
For example:
I got: Additional information : Must pass
replace:
with:
see
So the annotation allows you to further specify requirements, i.e if you have the following model:
You can then automatically have the validation message shown in your ASP.Net page like so:
So basically, you add a field for the validation message that will be populated by ASP.Net when the Required attribute kicks in.