Skip to content

Releases: galatanovidiu/abilities-rest-adapter

0.1.2

Choose a tag to compare

@galatanovidiu galatanovidiu released this 10 Jul 09:25
1288998

Hardens REST route adaptation and schema contracts.

  • Prevents overlapping route patterns from dispatching a sibling permission callback or handler.
  • Supports all WordPress-compatible PCRE named-capture syntaxes through the new Route_Pattern module.
  • Preserves nested schema property maps, defaults, empty-object shape, and recursive output context filtering.
  • Hardens callable, direct, and controller schema fallback paths against malformed or propertyless schemas.
  • Rejects unsupported methods, malformed metadata, incoherent safety annotations, and output callbacks without a non-empty output schema.
  • Preserves the public Rest_Route_Ability::build_args(): array contract for downstream consumers.

Compatibility notes:

  • Every non-readonly operation must declare boolean destructive and idempotent annotations.
  • Readonly operations cannot declare contradictory safety hints.
  • Callable output_callback declarations require a non-empty output_schema.
  • Supported methods are GET, POST, PUT, PATCH, and DELETE.

Validation:

  • Adapter: 101 PHPUnit tests / 287 assertions, PHPCS, PHPStan, PHP 7.4-8.5 CI matrix.
  • abilities-catalog downstream: PHPCS, PHPStan, and single-site/multisite suites on PHP 8.1 and 8.3.

0.1.1

Choose a tag to compare

@galatanovidiu galatanovidiu released this 09 Jul 09:27

Fix Composer PHP constraint for PHP 8.x installs.

  • composer.json: change php requirement from ^7.4 to ^7.4 || ^8.0
  • Composer treats ^7.4 as PHP 7.4 only; PHP 8 users could not composer require the package

```bash
composer require galatanovidiu/abilities-rest-adapter
```

0.1.0

Choose a tag to compare

@galatanovidiu galatanovidiu released this 09 Jul 09:19

Initial release of the Abilities REST Adapter.

Define Abilities API abilities by reusing existing REST API routes — schema, validation, permission check, and handler — via rest_do_request().

Installation

Composer (plugin developers):
```bash
composer require galatanovidiu/abilities-rest-adapter
```

WordPress plugin (site-wide):
Install the abilities-rest-adapter.zip asset from this release, or:
```bash
wp plugin install https://github.com/galatanovidiu/abilities-rest-adapter/releases/download/v0.1.0/abilities-rest-adapter.zip --activate
```

See README and docs/usage.md for details.