Repository navigation
Fix $ in path parameters treated as Regex.Replace back-references #311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d8be152
12033b6
df92383
4e27fee
4b77400
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -85,38 +85,42 @@ module RuntimeHelpers = | |||||
| | _ -> obj.ToString() | ||||||
|
|
||||||
| let toQueryParams (name: string) (obj: obj) (client: Swagger.ProvidedApiClientBase) = | ||||||
| match obj with | ||||||
| | :? array<byte> as xs -> [ name, (client.Serialize xs).Trim('\"') ] // TODO: Need to verify how servers parse byte[] from query string | ||||||
| | :? array<bool> as xs -> xs |> toStrArray name | ||||||
| | :? array<int32> as xs -> xs |> toStrArray name | ||||||
| | :? array<int64> as xs -> xs |> toStrArray name | ||||||
| | :? array<float32> as xs -> xs |> toStrArray name | ||||||
| | :? array<double> as xs -> xs |> toStrArray name | ||||||
| | :? array<string> as xs -> xs |> toStrArray name | ||||||
| | :? array<DateTime> as xs -> xs |> toStrArrayDateTime name | ||||||
| | :? array<DateTimeOffset> as xs -> xs |> toStrArrayDateTimeOffset name | ||||||
| | :? array<Guid> as xs -> xs |> toStrArray name | ||||||
| | :? array<Option<bool>> as xs -> xs |> toStrArrayOpt name | ||||||
| | :? array<Option<int32>> as xs -> xs |> toStrArrayOpt name | ||||||
| | :? array<Option<int64>> as xs -> xs |> toStrArrayOpt name | ||||||
| | :? array<Option<float32>> as xs -> xs |> toStrArrayOpt name | ||||||
| | :? array<Option<double>> as xs -> xs |> toStrArrayOpt name | ||||||
| | :? array<Option<string>> as xs -> xs |> toStrArrayOpt name | ||||||
| | :? array<Option<DateTime>> as xs -> xs |> toStrArrayDateTimeOpt name | ||||||
| | :? array<Option<DateTimeOffset>> as xs -> xs |> toStrArrayDateTimeOffsetOpt name | ||||||
| | :? array<Option<Guid>> as xs -> xs |> toStrArray name | ||||||
| | :? Option<bool> as x -> x |> toStrOpt name | ||||||
| | :? Option<int32> as x -> x |> toStrOpt name | ||||||
| | :? Option<int64> as x -> x |> toStrOpt name | ||||||
| | :? Option<float32> as x -> x |> toStrOpt name | ||||||
| | :? Option<double> as x -> x |> toStrOpt name | ||||||
| | :? Option<string> as x -> x |> toStrOpt name | ||||||
| | :? Option<DateTime> as x -> x |> toStrDateTimeOpt name | ||||||
| | :? Option<DateTimeOffset> as x -> x |> toStrDateTimeOffsetOpt name | ||||||
| | :? DateTime as x -> [ name, x.ToString("O") ] | ||||||
| | :? DateTimeOffset as x -> [ name, x.ToString("O") ] | ||||||
| | :? Option<Guid> as x -> x |> toStrOpt name | ||||||
| | _ -> [ name, (if isNull obj then null else obj.ToString()) ] | ||||||
| if isNull obj then | ||||||
| [] | ||||||
| else | ||||||
|
|
||||||
| match obj with | ||||||
| | :? array<byte> as xs -> [ name, (client.Serialize xs).Trim('\"') ] // TODO: Need to verify how servers parse byte[] from query string | ||||||
| | :? array<bool> as xs -> xs |> toStrArray name | ||||||
| | :? array<int32> as xs -> xs |> toStrArray name | ||||||
| | :? array<int64> as xs -> xs |> toStrArray name | ||||||
| | :? array<float32> as xs -> xs |> toStrArray name | ||||||
| | :? array<double> as xs -> xs |> toStrArray name | ||||||
| | :? array<string> as xs -> xs |> toStrArray name | ||||||
| | :? array<DateTime> as xs -> xs |> toStrArrayDateTime name | ||||||
| | :? array<DateTimeOffset> as xs -> xs |> toStrArrayDateTimeOffset name | ||||||
| | :? array<Guid> as xs -> xs |> toStrArray name | ||||||
| | :? array<Option<bool>> as xs -> xs |> toStrArrayOpt name | ||||||
| | :? array<Option<int32>> as xs -> xs |> toStrArrayOpt name | ||||||
| | :? array<Option<int64>> as xs -> xs |> toStrArrayOpt name | ||||||
| | :? array<Option<float32>> as xs -> xs |> toStrArrayOpt name | ||||||
| | :? array<Option<double>> as xs -> xs |> toStrArrayOpt name | ||||||
| | :? array<Option<string>> as xs -> xs |> toStrArrayOpt name | ||||||
| | :? array<Option<DateTime>> as xs -> xs |> toStrArrayDateTimeOpt name | ||||||
| | :? array<Option<DateTimeOffset>> as xs -> xs |> toStrArrayDateTimeOffsetOpt name | ||||||
| | :? array<Option<Guid>> as xs -> xs |> toStrArray name | ||||||
|
||||||
| | :? array<Option<Guid>> as xs -> xs |> toStrArray name | |
| | :? array<Option<Guid>> as xs -> xs |> toStrArrayOpt name |
Copilot
AI
Mar 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getPropertyValues now unwraps F# options before building form/urlencoded content, but there are no assertions covering this behavior in the new RuntimeHelpers unit tests. Please add a regression test that verifies Some(value) becomes the inner value and None/null is omitted when producing key/value sequences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Query param serialization for
float32/doubleusesToString()(viatoStrArray), which is culture-sensitive. On machines with a comma decimal separator this will produce values like"1,5"in URLs; consider formatting numeric types withInvariantCulture(and aligning/adding tests accordingly) to make query strings stable across locales.