-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Description
Hi,
It seems to me, there is an issue related to example values generation logic for asp.net controllers
when a controller returns a single value (in a case when OAS3 is used).
The screenshot relates to this code
However, if you just for the sake of experiment change the return type from
[ProducesResponseType(typeof(Pet), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SerializableError), StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<ActionResult<Pet>> FindById(int petId)
{
to
ProducesResponseType(typeof(IEnumerable<Pet>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SerializableError), StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<ActionResult<IEnumerable<Pet>>> FindById(int petId)
{
it generates the expected example value

