You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run VisualStudio 2019, and Set as Startup project 'SwaggerODataSample'.
modify a method SwaggerODataSample.FunctionsController.GetSalesTaxRate to the next state:
[HttpGet]
[ProducesResponseType( typeof( IQueryable ), Status200OK )]
[ODataRoute( "GetSalesTaxRate(PostalCode={postalCode})" )]
[EnableQuery( AllowedQueryOptions = AllowedQueryOptions.Top | AllowedQueryOptions.Skip | AllowedQueryOptions.Count )]
public IQueryable GetSalesTaxRate( int postalCode )
{
return Enumerable.Repeat( "A", postalCode ).AsQueryable();
}
Run Solution (we already set the project 'SwaggerODataSample' as Startup).
Steps to reproduce the behavior:
Go to '/api/GetSalesTaxRate(PostalCode={postalCode})'
Click on 'Try it out'
Fill 'postalCode' field with value '1'
Fill 'top' field with value '1'
Click on 'Execute' - should be ok response
Delete the value from field 'top'
Click on 'Execute'
See error - validation for field 'top' requires value with validation popup text 'Value must be an integer'.
*BTW: 'skip' field has the same behavior.
EXPECTED RESULT:
The second 'Execute' should return values form backend.
ACTUAL RESULT:
See above in -> 'STEPS TO REPRODUCE' 8. See error - validation for field 'top' requires value with validation popup text 'Value must be an integer'.
ADDITIONAL DETAILS
I know that it can be UI issue (you wrote that it's not your responsibility), but I just use https://editor.swagger.io/ and it's not reproducible and saw that UI version is 3.52
there, but last swashbuckle uses 3.42 and it might be somehow related to the issue.
And also, it's very strange why calls without setting top or skip are working well all the time (screenshot below), but after 'top' field is used once it becomes broken, might some swashbuckle code influences on that.
The text was updated successfully, but these errors were encountered:
VERSION:
6.2.1
STEPS TO REPRODUCE:
[HttpGet]
[ProducesResponseType( typeof( IQueryable ), Status200OK )]
[ODataRoute( "GetSalesTaxRate(PostalCode={postalCode})" )]
[EnableQuery( AllowedQueryOptions = AllowedQueryOptions.Top | AllowedQueryOptions.Skip | AllowedQueryOptions.Count )]
public IQueryable GetSalesTaxRate( int postalCode )
{
return Enumerable.Repeat( "A", postalCode ).AsQueryable();
}
Steps to reproduce the behavior:
*BTW: 'skip' field has the same behavior.
EXPECTED RESULT:
The second 'Execute' should return values form backend.
ACTUAL RESULT:
See above in -> 'STEPS TO REPRODUCE' 8. See error - validation for field 'top' requires value with validation popup text 'Value must be an integer'.
ADDITIONAL DETAILS
I know that it can be UI issue (you wrote that it's not your responsibility), but I just use https://editor.swagger.io/ and it's not reproducible and saw that UI version is 3.52
there, but last swashbuckle uses 3.42 and it might be somehow related to the issue.
And also, it's very strange why calls without setting top or skip are working well all the time (screenshot below), but after 'top' field is used once it becomes broken, might some swashbuckle code influences on that.
The text was updated successfully, but these errors were encountered: