Skip to content

v1.1.0

Choose a tag to compare

@coagus coagus released this 22 May 01:05
· 110 commits to main since this release

πŸš€ Release v1.1.0

This release includes important improvements to the API's validation system, clearer error messages, and expanded unit test coverage to improve robustness and developer experience.

πŸ”§ PATCH, PUT, and Unit Tests

  • Enhanced error messages in put and patch methods for improved clarity.
  • Added additional validations for primary ID and input payloads in both methods.
  • Introduced new unit tests in APIDBTest to cover error scenarios related to invalid IDs and malformed input.

πŸ”§ URL Validation Unit Tests

  • Fixed error responses in the API class to include appropriate HTTP status codes.
  • Added unit tests in APITest to validate:
    • Uppercase and malformed URIs
    • Invalid characters
    • API and version structure
    • Trailing slashes in URIs
    • Plurality of resource names

πŸ”§ Structural Validation Refactor

  • Replaced the legacy run() method with a new validateRequest() function for centralized URI validation.
  • Improved URI validation logic to enforce correct structure and disallow invalid characters.
  • Added constants in constants.php to manage URI segment indexing.
  • Implemented isPlural() in utils.php to ensure resources are named in plural form.
  • Updated relevant tests to reflect new structure and error-handling logic.

πŸ”§ Secondary Resource Validation

  • Added validations to ensure:
    • Secondary resources are in plural form.
    • Corresponding entity class exists when a secondary ID is provided.
  • Added unit tests in APITest to cover new error cases related to invalid secondary resources.

βœ… This release strengthens API consistency and improves developer feedback through better validation and testing.