Optional route model binding type #938
Unanswered
apasquini95
asked this question in
Q&A
Replies: 1 comment 4 replies
-
|
Hey @apasquini95 |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone, I'm having an issue with optional routing models and their type representation in the openapi specification. Here is a simple routing with an optional model as path param:
And its controller:
When the openapi specification is generated, the model binding fallbacks to
string, instead of using the model's defined attribute binding (which should have beenint):I thaught it could have been a sort of convention, since path params are always required in a certain sense for the openapi syntax, so I tried to divide the original endpoint into two (without touching the controller implementation). This is the new routing:
But now the specification lacks of the
test_paramdeclaration in the endpoint without the model binding:Is this intended or am I doing something wrong?
Beta Was this translation helpful? Give feedback.
All reactions