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
{{ message }}
Repository navigation
Commit 8a0cc73
Browse filesBrowse the repository at this point in the historyBrowse files
* perf+test: replace UriBuilder+ParseQueryString with StringBuilder, add 9 tests (500→509)
Tasks: 8 (perf), 9 (tests), 5 (coding improvement)
perf: RuntimeHelpers.createHttpRequest
- Replace UriBuilder + System.Web.HttpUtility.ParseQueryString + NameValueCollection
with a single StringBuilder + Uri.EscapeDataString pass.
- Avoids 4-5 allocations per API call (UriBuilder, NameValueCollection, Hashtable,
intermediate strings). Now allocates only one StringBuilder.
- Encoding changes from form-encoding (spaces as '+') to RFC 3986
percent-encoding (spaces as '%20'); both are accepted by HTTP servers.
- Removes the Seq.isEmpty early-exit fast path (no longer needed — the
StringBuilder path is already allocation-efficient with zero params).
- Removes the now-unused System.Web.HttpUtility reference.
coding: RuntimeHelpers.toFormUrlEncodedContent
- Merge the Seq.filter + Seq.choose passes into a single Seq.choose, avoiding
an intermediate sequence allocation for the common case.
tests (9 new, 500→509):
- RuntimeHelpersTests: 4 tests documenting RFC 3986 percent-encoding in
createHttpRequest (spaces, & and = in values, spaces in names).
- Schema.OperationCompilationTests: 2 tests asserting that the '200' response
takes priority over '201' when both are present in an operation.
- Schema.V2SchemaCompilationTests: 4 tests verifying compiled operation return
types from a Swagger 2.0 petstore (listPets→Task<Pet[]>, getPet→Task<Pet>,
getPet path param int64, createPet→Task<IO.Stream> per OpenApi normalisation).
Build/test:
- dotnet fantomas --check: no issues
- Unit tests: 509 total, 0 failed, 1 skipped
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* ci: trigger checks
* fix: handle existing query and fragment in createHttpRequest
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
0 commit comments