Closed pranavkm closed 6 years ago
From @RSuter on August 1, 2018 21:55
@pranavkm is this something which is missing in api explorer?
Or should this be implemented in the AspNetCoreToSwaggerGenerator?
Hmm, this does seem like a bug in API explorer
This issue can be closed, as this was a problem in NSwag and not in API Explorer...
apiParameter.Type (ApiParameterDescription)
is null for these implicit parameters - NSwag now assumes typeof(string) (and not nullable for path parameters). Is this "always" correct? Or is there a way to better infer the type or maybe API Explorer should provide a type?
maybe API Explorer should provide a type
The type's inferred from the type of the parameter. Presumably there's not much to infer here - outside of possibly setting it to typeof(void)
. Guess not assigning it just as meaningful.
From @syska on August 1, 2018 21:51
Not sure if this is an issue ... using the API Explorer in nswag.
The route looks like this:
/api/{language}/baskets/{basketId}
language
is used by aspnetcore to set the CultureThe controller looks like this:
The swagger file from swashbuckle looks like this:
The client generated from with the API Explorer just removed the
{language}
parameter ... so the url ends up looking like/api/baskets/{basketId}
... and ofcause it can't hit the URL cause its missing the{language}
part ...This works if we put the {language} parameter in the method signature ... is this by design? If it is ... and I can kind a understand why ... is there any way to overcome this somehow? We need this to set the Culture ... but with a MiddlewareFilter injected on all method before route action is performed ...
Copied from original issue: RSuter/NSwag#1500