Reputation: 7736
Using Swashbuckle
5.6.3. Controller method looks like:
public async Task<IActionResult> GenerateTokenAsync([FromForm] TokenCredentials tokenCredentials)
TokenCredentials
looks like:
[Required]
public GrantType? grant_type
{
get;
set;
}
GrantType
looks like:
public enum GrantType
{
client_credentials = 0
}
The enum shows in Swagger and shows as required, but when I hit the execute button, I get the red bounce of death. If I take off the Required, then it executes. I also tried NotNull
, but that let it through regardless.
Am I missing something?
Upvotes: 0
Views: 622
Reputation: 18209
You can use Swashbuckle.AspNetCore
5.5.0,it's OK. Here is an official document
Or you can delete [FromForm]
in Swashbuckle 5.6.3.
Upvotes: 1