v1.1.0
π 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
putandpatchmethods for improved clarity. - Added additional validations for primary ID and input payloads in both methods.
- Introduced new unit tests in
APIDBTestto cover error scenarios related to invalid IDs and malformed input.
π§ URL Validation Unit Tests
- Fixed error responses in the
APIclass to include appropriate HTTP status codes. - Added unit tests in
APITestto 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 newvalidateRequest()function for centralized URI validation. - Improved URI validation logic to enforce correct structure and disallow invalid characters.
- Added constants in
constants.phpto manage URI segment indexing. - Implemented
isPlural()inutils.phpto 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
APITestto cover new error cases related to invalid secondary resources.
β This release strengthens API consistency and improves developer feedback through better validation and testing.