Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: reactiveui/refit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v16.1.0
Choose a base ref
...
head repository: reactiveui/refit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v16.2.0
Choose a head ref
  • 11 commits
  • 192 files changed
  • 2 contributors

Commits on Sep 25, 2026

  1. chore(deps): update dependency reactiveui.primitives to 8.1.0 (#2334)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Sep 25, 2026
    Configuration menu
    Copy the full SHA
    b7ca029 View commit details
    Browse the repository at this point in the history
  2. chore: update packages, credit Refit's origins, remove stale files (#…

    …2336)
    
    Bump TUnit to 1.69.0, ReactiveUI.Primitives to 8.2.0 and the net8.0
    ASP.NET Components.WebAssembly pins to 8.0.31.
    
    Fold the original 2012 GitHub MIT notice from COPYING into LICENSE under
    an attribution section, with credit to Anna Betts and to Square's
    Retrofit, and delete COPYING.
    
    Remove the devcontainer (never picked up, .NET 7 era), the unused
    buildtask.snk and CodeCoverage.runsettings, the unreferenced legacy
    stylesheets folder and the orphaned lombiq sponsor image.
    glennawatson authored Sep 25, 2026
    Configuration menu
    Copy the full SHA
    2ecbf2a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7aa89fa View commit details
    Browse the repository at this point in the history
  4. docs: new Refit logo and official sponsor logos

    Replace the old green "r" badge with a new logo: a lowercase r in the
    ReactiveUI rounded stroke style and Refit's original greens, between an
    interface brace and outgoing HTTP calls in ReactiveUI blue. The SVG
    masters live in images/, and images/logo.png is a 512px export of the
    square icon used as the NuGet package icon.
    
    Swap the JetBrains and Claude logos for the official assets from the
    JetBrains brand kit and the Anthropic press kit, with light and dark
    variants, and name and link each sponsor, adding OpenAI's Codex.
    glennawatson committed Sep 25, 2026
    Configuration menu
    Copy the full SHA
    176ebdb View commit details
    Browse the repository at this point in the history
  5. docs(readme): keep the README renderable on nuget.org

    The README ships as the NuGet package readme, and nuget.org renders only
    Markdown, drops raw HTML, and only shows images from allow-listed hosts
    with absolute URLs. Use Markdown images served from
    raw.githubusercontent.com and absolute links for repository files.
    
    Without HTML there is no per-theme picture switching, so the sponsor
    logos are the official artwork placed on a white card that reads on
    light and dark themes alike, and the Refit logo SVG carries its own
    display size.
    glennawatson committed Sep 25, 2026
    Configuration menu
    Copy the full SHA
    a330a63 View commit details
    Browse the repository at this point in the history
  6. docs(readme): credit OpenAI's Codex for Open Source support

    Add the official OpenAI wordmark, from OpenAI's brand page download,
    on the same white card as the other sponsors, keeping the wordmark's
    built-in clear space. Describe the support as it is, Codex for Refit's
    maintainers through Codex for Open Source, and note that the sponsor
    names and logos belong to their owners.
    glennawatson committed Sep 25, 2026
    Configuration menu
    Copy the full SHA
    7333739 View commit details
    Browse the repository at this point in the history
  7. docs(readme): name the programme behind each sponsor

    JetBrains provides tool licences through its open source support programme and Anthropic provides Claude through Claude for Open Source, alongside OpenAI's Codex for Open Source.
    glennawatson committed Sep 25, 2026
    Configuration menu
    Copy the full SHA
    5d17ac9 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    ceb75e8 View commit details
    Browse the repository at this point in the history
  9. feat(testing): add controllable streams, request capture and a test c…

    …lock to Refit.Testing (#2337)
    
    - StreamSource releases a response body chunk by chunk (JSON Lines, SSE or JSON array),
      with Complete, Disconnect and Fail; Reply.Stream, Reply.JsonLines and Reply.ServerSentEvents
      expose it through the route table.
    - StubHttp.RequestCapture chooses Full (default), None or Bounded(maxBytes) so a streaming
      upload can be consumed by the reply code instead of being buffered by the handler.
    - StubHttp.TimeProvider drives NetworkBehavior delays and VerifyAllCalledAsync timeouts.
    - Replace every while (true) loop with a loop that has a real condition.
    - Bump PublicApiSharp.Analyzers to 2.1.0.
    - Add the testing-streaming documentation example and update the README.
    glennawatson authored Sep 25, 2026
    Configuration menu
    Copy the full SHA
    d864935 View commit details
    Browse the repository at this point in the history
  10. feat(bodies): typed JSON Lines uploads from IEnumerable<T> and IAsync…

    …Enumerable<T> (#2338)
    
    * feat(bodies): typed JSON Lines content for IEnumerable<T> and IAsyncEnumerable<T> uploads
    
    * test(bodies): cover typed JSON Lines uploads
    
    - Refit.Tests/JsonLinesContentTypedTests.cs: unit tests for
      JsonLinesContent<T> (ctor null checks, sync output byte-identical to
      the non-generic content, async one-line-per-element output, sync
      resend re-enumeration, async resend throws, enumerator disposal on
      completion/exception/cancellation, EnumeratorCancellation wiring,
      flush-before-wait ordering) and the CreateTypedJsonLinesBodyContent /
      CreateAsyncJsonLinesBodyContent factory fallback and selection rules.
    - Refit.Tests/JsonLinesUploadAcceptanceTests.cs +
      IJsonLinesUploadApi.cs/UploadRecord.cs/UploadJsonContext.cs: an
      end-to-end acceptance test for a generated client uploading
      IAsyncEnumerable<T> as JSON Lines via RestService.ForGenerated with a
      source-generated JsonSerializerContext, proving data reaches a
      StubHttp responder before production completes and that mid-upload
      cancellation unwinds the producer cleanly.
    - Refit.Tests/JsonLinesUploadBoundedMemoryTests.cs: streams 50,000
      records through JsonLinesContent<T> and asserts the producer never
      runs more than one record ahead of what the destination stream has
      received.
    - Refit.Tests/IRequestBin.cs + RequestBuilderTests.cs: reflection
      builder parity for an IAsyncEnumerable<T> JSON Lines body.
    - Refit.Testing.Tests/ReplyFromCancellableTests.cs: Reply.From's
      cancellable overload receives the send's token, and both unbounded
      and bounded request-body capture forward cancellation while a
      streaming body is mid-copy.
    - Refit.GeneratorTests: parser helper tests for
      Parser.FindJsonLinesElementType (sync/async/dual-interface/string/
      nullable/type-parameter classification), emission tests for the
      typed/async/untyped factory selection, and a snapshot test pair
      (async + typed-sync).
    - Refit.GeneratedCode.TestModels: a JSON Lines scenario (typed-sync and
      async bodies) compiling under the repository analyzers.
    
    Implementation fix: SystemTextJsonContentSerializer.WritesDeclaredTypeAsObject
    always returned false for the default serializer, because its own
    built-in ObjectToInferredTypesConverter (added by
    GetDefaultJsonSerializerOptions) reports CanConvert(object) == true.
    That converter's Write already re-serializes by the value's runtime
    type, which for the value/sealed element types this method restricts
    itself to is always the declared type, so it writes the same JSON a
    typed write would. The doc comment already described this exemption;
    the code didn't implement it, so the typed JSON Lines path never
    engaged for RefitSettings' default serializer. Now the converter is
    special-cased so the typed path applies whenever nothing else claims
    to handle object.
    
    * docs(examples): typed async JSON Lines uploads
    
    Add documentation examples for the typed asynchronous JSON Lines upload feature: an IAsyncEnumerable<T> producer with a registered JsonSerializerContext, the typed IEnumerable<T> case, the JsonLinesContent<T> escape hatch for a polymorphic base type, retry/buffering guidance, and a Refit.Testing example reading the upload line by line with RequestCapture.None and the cancellable Reply.From overload.
    
    * test(aot): smoke typed async JSON Lines upload
    
    Add an INativeAotApi.UploadAsync scenario exercising
    [Body(BodySerializationMethod.JsonLines)] IAsyncEnumerable<SmokeRecord>, called through
    ForGenerated(client, context). NativeAotSmokeHandler reads the request body incrementally via
    HttpContent.CopyToAsync(observerStream, cancellationToken), as SocketsHttpHandler does, and
    signals the caller as soon as the producer's first bytes arrive.
    
    The smoke run asserts: (a) each element round-trips through the registered JSON context with
    camelCase property names, under Native AOT with reflection disabled; (b) data reaches the
    handler while the producer is still producing - the producer blocks after its first element on
    a gate only the handler's first-write callback releases, verified by capturing the number of
    records yielded at that moment; (c) cancelling the call's token mid-upload cancels the producer
    through its [EnumeratorCancellation] token, runs its finally block, stops it short of every
    record, and surfaces as OperationCanceledException. Both scenarios carry their own timeout so a
    regression fails loudly instead of hanging (verified manually by breaking the backpressure gate
    release, which now throws and exits non-zero within the timeout instead of hanging).
    
    * test(aot): use a plain comment on the smoke producer local function
    
    * chore: ignore local AI agent folders and worktrees
    
    * docs(examples): testing examples per test framework
    
    Add src/examples/Documentation/TestingFrameworks/{XUnit,NUnit,MSTest,TUnit}, four
    parallel test projects demonstrating Refit.Testing (StubHttp routes/replies, request
    verification and capture, streaming replies via StreamSource, network faults and the
    test clock, generated clients, and a JSON Lines upload read live via Reply.From with
    RequestCapture.None). All four share identical scenarios, file names and test names;
    only the framework's attributes and assert calls differ. Each folder has its own
    Directory.Packages.props (importing the parent) and a README describing how to run it
    and the scenarios it covers.
    
    Exclude TestingFrameworks from every Pages/*.csproj shared-source glob so framework
    code never compiles into the page projects, and add the four projects to Refit.slnx.
    
    Relax a handful of production-strictness analyzer rules (doc-comment-required,
    magic-literal/number, DebuggerDisplay-required, xUnit's per-framework cancellation
    token suggestion) for TestingFrameworks/**/*.cs only, via a scoped section in
    src/examples/Documentation/.editorconfig, so the tests read top to bottom for a
    newcomer without fighting the repo's usual production strictness.
    
    Fix Testing/TestingStreaming.cs ShowLiveUploadAsync: it claimed to read an upload
    line by line as it arrives but used request.Content.ReadAsStreamAsync, which
    buffers the whole body first for this content type. It now copies the live request
    content through a System.IO.Pipelines.Pipe concurrently with
    JsonSerializer.DeserializeAsyncEnumerable (topLevelValues: true, using the
    source-generated JsonTypeInfo so it stays AOT-safe), and gates the producer so its
    second person cannot be yielded until the reader has genuinely consumed the first
    one - proving the read is incremental rather than buffered.
    
    * feat(bodies): terminate every async JSON Lines line and make the upload samples readable
    
    * docs(examples): readability fixes for the testing and JSON Lines samples
    
    * docs(examples): readable Refit.Testing samples for the testing pages
    
    * docs(examples): simplify the Refit.Testing samples for excerpting
    
    * docs(examples): explain the second duplicate-query request
    
    * docs(examples): drop the last discards from the testing samples
    
    * docs(examples): final readability fixes for the testing topic samples
    
    * ci: test the suites and the TUnit example with testProjects
    glennawatson authored Sep 25, 2026
    Configuration menu
    Copy the full SHA
    0418743 View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2026

  1. test(bodies): cover the remaining typed JSON Lines branches (#2339)

    * test(bodies): cover the remaining typed JSON Lines branches
    
    Adds reflection request-builder and JsonLinesContent<T> tests to close the
    Codecov patch-coverage gaps on PR #2338:
    
    - FindAsyncJsonLinesElementType: a class implementing IAsyncEnumerable<T> is
      found through GetInterfaces (rather than being that interface itself), and
      a type implementing two distinct IAsyncEnumerable<> interfaces is treated
      as ambiguous and returns null.
    - JsonLinesContent<T>.MoveNextAsync: a stream whose FlushAsync throws while
      the producer's next step is still pending propagates the failure only
      after that step completes, so the enumerator is never disposed while it
      is in flight.
    
    Two lines remain uncovered and are genuinely unreachable, not contorted
    around:
    - JsonLinesContent<T>'s 2-arg SerializeToStreamAsync override: on
      NET8_0_OR_GREATER, HttpContent's internal plumbing always invokes the
      3-arg CancellationToken overload (verified empirically), so the 2-arg
      override is dead code once both are overridden; it only matters on the
      netfx targets that lack the 3-arg overload.
    - The closing brace of the catch block in MoveNextAsync: that catch always
      ends with 'throw;', so the sequence point for falling through the catch
      normally can never fire.
    
    * test(bodies): cover the .NET Framework serialize entry point and simplify the flush wait
    
    * test(bodies): arm the flush failure only after the first element is written
    glennawatson authored Sep 26, 2026
    Configuration menu
    Copy the full SHA
    a463e8a View commit details
    Browse the repository at this point in the history
Loading
⌂ 换网址