Skip to content

fix: RootResponse class#107

Merged
cuongph87 merged 5 commits intomasterfrom
feature/fix-root-response
Dec 8, 2025
Merged

fix: RootResponse class#107
cuongph87 merged 5 commits intomasterfrom
feature/fix-root-response

Conversation

@cuongph87
Copy link
Copy Markdown
Contributor

@cuongph87 cuongph87 commented Dec 2, 2025

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Note

Introduce RootResponseLinks and make RootResponse include required properties and new fields aligned with Horizon 24.x; update tests and JSON fixture accordingly.

  • Responses:
    • Update StellarDotnetSdk/Responses/RootResponse.cs:
      • Make class sealed; add required Links property and mark always-present fields as required.
      • Add history_latest_ledger_closed_at and supported_protocol_version properties.
    • Add StellarDotnetSdk/Responses/RootResponseLinks.cs defining typed _links for account, accounts, account_transactions, assets, claimable_balances, effects, fee_stats, friendbot, ledger, ledgers, liquidity_pools, offer, offers, operation, operations, order_book, payments, self, strict_receive_paths, strict_send_paths, trade_aggregations, trades, transaction, transactions.
  • Tests:
    • Update StellarDotnetSdk.Tests/TestData/Responses/root.json to Horizon/Core 24.x and testnet URLs; include new fields.
    • Expand StellarDotnetSdk.Tests/Responses/RootDeserializerTest.cs to assert new properties and all link hrefs.

Written by Cursor Bugbot for commit 473d54c. Configure here.

@jopmiddelkamp jopmiddelkamp requested a review from Copilot December 2, 2025 16:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the RootResponse class by adding proper null-safety, introducing a dedicated RootResponseLinks class, and updating test data to match current Horizon API responses. The changes enforce that always-present properties are marked as required, improving type safety and preventing null reference issues.

Key Changes:

  • Introduced required modifier to all always-present properties in RootResponse
  • Created a new RootResponseLinks class to properly model the _links section
  • Updated test data to reflect current Horizon API structure

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
StellarDotnetSdk/Responses/RootResponseLinks.cs New class modeling the _links section with strongly-typed link properties
StellarDotnetSdk/Responses/RootResponse.cs Added required modifiers, XML documentation, new Links property, and removed nullable disable directive
StellarDotnetSdk.Tests/TestData/Responses/root.json Updated test data with current Horizon API structure and protocol versions
StellarDotnetSdk.Tests/Responses/RootDeserializerTest.cs Expanded test assertions to validate all properties including the new Links property

Comment thread StellarDotnetSdk.Tests/Responses/RootDeserializerTest.cs Outdated
Comment thread StellarDotnetSdk.Tests/Responses/RootDeserializerTest.cs Outdated
Comment thread StellarDotnetSdk.Tests/Responses/RootDeserializerTest.cs Outdated
Comment thread StellarDotnetSdk/Responses/RootResponse.cs
@jopmiddelkamp
Copy link
Copy Markdown
Contributor

bugbot run

Comment thread StellarDotnetSdk.Tests/Responses/RootDeserializerTest.cs Outdated
@cuongph87 cuongph87 force-pushed the feature/fix-root-response branch from ab49bea to f1568a0 Compare December 4, 2025 04:16
Comment thread StellarDotnetSdk/Responses/RootResponse.cs Outdated
Comment thread StellarDotnetSdk/Responses/RootResponseLinks.cs Outdated
Comment thread StellarDotnetSdk/Responses/RootResponseLinks.cs Outdated
@cuongph87 cuongph87 force-pushed the feature/fix-root-response branch from ea56c2d to 0e33c14 Compare December 8, 2025 03:16
@cuongph87 cuongph87 merged commit 7078f81 into master Dec 8, 2025
1 check failed
@cuongph87 cuongph87 deleted the feature/fix-root-response branch December 8, 2025 03:21
@cuongph87 cuongph87 added the fix label Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix RootResponse class

3 participants