Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 29, 2025

Addresses #325: Enables configurable request parameters and graph accumulation in OslcClient, properly resolving #19 and #204 (header overwriting issues).

Changes

  • OslcRequestParams class — Configures Accept, Content-Type, OSLC-Core-Version, and custom headers. Supports merge semantics for per-request overrides.

    • Pre-built configs: Default, RdfXmlOnly, TurtleOnly
    • Fluent Builder() API
  • Graph accumulationEnableGraphAccumulation() / DisableGraphAccumulation() for discovery phase workflows where responses should merge into a single graph

  • Per-request parameter overrides — New overloads for GetResourceAsync and CreateResourceAsync accepting OslcRequestParams

  • DefaultRequestParams property — Set globally in constructor or per-request

Usage

// Constructor-level defaults
var client = new OslcClient(logger, OslcRequestParams.RdfXmlOnly);

// Per-request override
var customParams = OslcRequestParams.Builder()
    .WithAccept("text/turtle")
    .WithHeader("X-Custom", "value")
    .Build();
await client.GetResourceAsync<ServiceProvider>(uri, null, customParams);

// Discovery with graph accumulation
var graph = client.EnableGraphAccumulation();
await client.GetResourceAsync<ServiceProviderCatalog>(catalogUri);
await client.GetResourceAsync<ServiceProvider>(spUri);
// graph now contains merged triples from both responses

Notes

  • OslcRestClient remains deprecated (since 0.5.0)
  • 21 new unit tests added
  • All existing APIs unchanged
Original prompt

This section details on the original issue you should resolve

<issue_title>Merge OslcClient and OslcRestClient</issue_title>
<issue_description>- [ ] Ensure #19 and #204 are solved properly. I am thinking of OslcRequestParams that we pre-set in the library, allow the user to set in the ctor, or to override on a per-request basis (mainly, to request/specify certain types, e.g. request only RDF/XML for root services or POST RDF/XML-ABBREV in some special cases)

  • Allow access of both unmarshalled POCOs as well as access to the raw response graph.
  • Allow the client to be set to accumulate the responses in a single graph - useful for the initial discovery phase.</issue_description>

<agent_instructions>OslcClient should remain. Increase test coverage during the join.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@berezovskyi OslcRestClient is largely deprecated since 0.5.0 - OslcClient is the primary client.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Nov 29, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 29, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI changed the title [WIP] Merge OslcClient and OslcRestClient with enhancements Add OslcRequestParams and graph accumulation support to OslcClient Nov 29, 2025
Copilot AI requested a review from berezovskyi November 29, 2025 19:37
@codecov
Copy link

codecov bot commented Nov 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.22%. Comparing base (97a6fca) to head (60c2153).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #468      +/-   ##
==========================================
+ Coverage   50.69%   51.22%   +0.53%     
==========================================
  Files         169      170       +1     
  Lines       10205    10309     +104     
  Branches     1017     1039      +22     
==========================================
+ Hits         5173     5281     +108     
+ Misses       4770     4761       -9     
- Partials      262      267       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge OslcClient and OslcRestClient

2 participants