Skip to content

Define stable health response structure for network-node crate - #350

Merged
El-swaggerito merged 1 commit into
Axionvera:mainfrom
ReinaMaze:feature/stable-health-response
Aug 23, 2026
Merged

Define stable health response structure for network-node crate#350
El-swaggerito merged 1 commit into
Axionvera:mainfrom
ReinaMaze:feature/stable-health-response

Conversation

@ReinaMaze

Copy link
Copy Markdown
Contributor

close #338

Define stable health response structure for network-node crate

Summary

Establishes a predictable, structured health check response for the network-node library to support downstream tooling integration.

Changes

  • HealthResponse struct: Defines stable response shape with four fields:

    • status: Health check status (currently "ok")
    • service_name: Identifies the service ("axionvera-network-node")
    • version: Package version from Cargo.toml
    • environment: Optional network/environment identifier
  • health_status() function: Returns structured HealthResponse with optional environment parameter

  • Serialization support: Full serde integration for JSON serialization/deserialization

  • Comprehensive test suite: 18 tests covering:

    • Happy path scenarios (with/without environment)
    • All required fields validation
    • Multiple environment values (production, staging, development)
    • JSON serialization and deserialization
    • Response consistency and equality
    • Edge cases (empty strings, long strings)
    • Struct derives (Debug, Clone)

Testing

  • All 18 unit tests pass
  • cargo fmt complies with style guidelines
  • cargo check verifies compilation
  • cargo clippy passes linter checks

Notes

  • Library-level implementation only (no HTTP server added)
  • Maintains backward compatibility with existing code
  • Ready for downstream integration

- Add HealthResponse struct with status, service_name, version, and environment fields
- Implement health_status() function returning structured response
- Support JSON serialization/deserialization via serde
- Add comprehensive test coverage for happy path, edge cases, and serialization
- All tests pass: cargo fmt, cargo check, cargo test, cargo clippy validation
@El-swaggerito
El-swaggerito merged commit 24049f2 into Axionvera:main Aug 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document vault contract public methods

2 participants