We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have a project (C# API and Blazor WebAssembly client side). I have this data annotation on one of my property.
[Required(ErrorMessage = "My custom error message")] public string Client { get; set; }
I'm using NSwag to generate my client side. NSwag generates this:
[Newtonsoft.Json.JsonProperty("client", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public string Client { get; set; }
So property "ErrorMessage" was not generated. It should generate:
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true, ErrorMessage = "My custom error message")]
I can add this manually, but I would like that NSwag generates this. Is this not possible or am I missing something?
*I've found this similar topic #2297 (comment) but I can't help myself with it.
The text was updated successfully, but these errors were encountered:
Is this not possible or am I missing something?
Open API does not have a way to describe this - ie its not possible ATM. However with custom properties and custom templates it would be possible...
Sorry, something went wrong.
No branches or pull requests
I have a project (C# API and Blazor WebAssembly client side). I have this data annotation on one of my property.
I'm using NSwag to generate my client side. NSwag generates this:
So property "ErrorMessage" was not generated. It should generate:
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true, ErrorMessage = "My custom error message")]
I can add this manually, but I would like that NSwag generates this. Is this not possible or am I missing something?
*I've found this similar topic #2297 (comment) but I can't help myself with it.
The text was updated successfully, but these errors were encountered: