Open jimcullenaus opened 5 years ago
Is there anything holding this up PR?
The PR is not against this repo!?
@drewfreyling the intent was to get it tested and approved in our own repo first before pushing to this one. I didn't even realise that linking off Issue for reference would notify this thread about it. Unfortunately I didn't know how to test and nobody else considered it priority.
Observed problem
I have a parameter in OpenAPI that has
in: path
on it.It is being generated in to .netcore C# code as
[Microsoft.AspNetCore.Mvc.FromHeader]
.I can not find any way to detect in the controller liquid template to differentiate between header and path parameters.
Sample code
I have the following OpenAPI specification:
And am generating C# .netcore code using the following template:
The output result is (with manual formatting changes for ease of reading):
As a result, when the code is called,
userId
is always null, because it is from the route, not the header. If I manually changeFromHeader
toFromRoute
, it works fine. Unfortunately, I can find no way in the liquid template to detect that a parameter has the OpenApiin: path
option set.parameter.IsBody
works as expected, but none of.IsPath
,.IsRoute
,.IsHeader
, or.IsHead
ever evaluate to anything.Expected behaviour
operation.Parameters
should contain items that have aIsBody
,IsPath
andIsHeader
property on them, and this should match thein
value for the parameter from the OpenAPI specification.