Restier Swagger not applying route prefix
i configured by Restier with a route prefix of 'odata' and this works when i use it directly but the swagger ui does not seem to have that and errors.
example from swagger ui of wrong example:
curl -X 'GET' \ 'https://localhost:7221/Addresses?%24top=100' \ -H 'accept: application/json'
it should be:
curl -X 'GET' \ 'https://localhost:7221/odata/Addresses?%24top=100' \ -H 'accept: application/json'
also actual output shows :
{ "@odata.context": "https://localhost:7221/odata/$metadata#Addresses", "value": [ { "Id": 1, ... } ] }
Assemblies affected
restier swagger 1.1.0
Reproduce steps
use the sample for noerthwind and just add routprefix and try it.
from my code:
app.UseEndpoints(endpoints => { endpoints.Select().Expand().Filter().OrderBy().MaxTop(100).Count().SetTimeZoneInfo(TimeZoneInfo.Utc); endpoints.MapRestier(builder => { builder.MapApiRoute<RiaODataController>("v1", "odata", true); }); });
Expected result
swagger ui would show the route as
curl -X 'GET' \ 'https://localhost:7221/odata/Addresses?%24top=100' \ -H 'accept: application/json'
and the ui "try it" button would return data
Actual result
http error 404 - not found
I just submitted #755 which will fix this issue.