Skip to content

feat: add null handling for round trip parameter and add verifying test#2201

Open
TimothyMakkison wants to merge 1 commit into
reactiveui:mainfrom
TimothyMakkison:roundtrip_null
Open

feat: add null handling for round trip parameter and add verifying test#2201
TimothyMakkison wants to merge 1 commit into
reactiveui:mainfrom
TimothyMakkison:roundtrip_null

Conversation

@TimothyMakkison

@TimothyMakkison TimothyMakkison commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Passing a null value into as a round tripping parameter would previously result in:

[Null Reference] Object reference not set to an instance of an object.
   at Refit.RequestBuilderImplementation.AppendDynamicRouteFragment(ValueStringBuilder& vsb, RestMethodInfoInternal restMethod, Object[] paramList, ParameterFragment fragment, RestMethodParameterInfo parameterMapValue)
  • I've added a null check, when the parameter is null it will instead call StringHelpers.EscapeDataString(_settings.UrlParameterFormatter.Format()), similar to how AppendObjectPropertyFragment and AppendDynamicRouteFragment handle it. This way the user can choose how this is handled.
    • Not sure if this would be considered to be a breaking change
  • Added a test verifying the behaviour

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant