Contributing¶
This document describes how to contribute to WP REST Client.
Adding a New Implementation¶
To add a new HTTP client implementation:
- Create a new module, for example
wp-rest-client-xyz - Implement the interfaces from
wp-rest-client-domain - Reuse the shared contract tests from
wp-rest-client-contract-tests - Provide implementation-specific test configuration
- Ensure all tests pass
A new implementation should not define its own behavioural rules.
The expected behaviour is defined by the domain API and verified by the shared contract tests.
Implementation Requirements¶
A compliant implementation should:
- Implement the public interfaces from
wp-rest-client-domain - Preserve the same behaviour as the existing implementations
- Map WordPress REST responses to the shared DTOs
- Handle errors consistently
- Pass the shared contract test suite
Testing¶
Before opening a pull request, run the full test suite.
Contract Tests¶
All implementations must pass the shared contract tests.
Contract tests are located in:
These tests define the expected behaviour of any compliant implementation.
Integration Tests¶
Integration tests are located in:
They verify compatibility against real WordPress instances using Testcontainers.
Internal Modules¶
The following modules are used for development and testing only:
wp-rest-client-domain-assertionswp-rest-client-contract-testswp-rest-client-test-integrationwp-rest-client-test-report
These modules are not intended for library consumers and are not deployed to Maven Central.
Documentation¶
User-facing documentation belongs in the root README.md.
Design, testing, and contributor-focused documentation belongs in the docs/ directory.