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
Is your feature request related to a problem? Please describe.
Some of my API endpoints use optional parameters, eg "includeCancelled" which defaults to true. When refitter generates endpoints, it includes these as required (but nullable) properties, or using the optionalParameters flag sets them to default (which is different than the default specified in the OpenAPI doc).
Describe the solution you'd like
Either set them to the default in the OpenAPI doc (if specified) or add multiple signatures for optional parameters.
Describe alternatives you've considered
Just passing null into optional arguments, as they are then not sent to the server, but this feels messy to me.
Reading this makes me think that we should improve our #417 Dynamic Querystring Parameters feature so that it would offers a constructor with all requiered parameters and let all other as properties. Or maybe all parameters in constructor with default/null values for optional ones, especially when using records.
Will take a look at it.
Is your feature request related to a problem? Please describe.
Some of my API endpoints use optional parameters, eg "includeCancelled" which defaults to true. When refitter generates endpoints, it includes these as required (but nullable) properties, or using the
optionalParameters
flag sets them to default (which is different than the default specified in the OpenAPI doc).Describe the solution you'd like
Either set them to the default in the OpenAPI doc (if specified) or add multiple signatures for optional parameters.
Describe alternatives you've considered
Just passing
null
into optional arguments, as they are then not sent to the server, but this feels messy to me.Additional context
Take for example the following controller:
The following code is generated:
Refitter settings:
Loving the project by the way!
The text was updated successfully, but these errors were encountered: