Download the PHP package yapro/apiration-bundle without Composer
On this page you can find all versions of the php package yapro/apiration-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package apiration-bundle
Api Ration Bundle
The library casts a json-request to your object and casts your object to a json-response.
How to use
-
Make an ApiRationObject, example SimpleModel
-
Use the SimpleModel in controller action (specify the namespace completely)
-
Make the curl request
- Get the answer
As you can see, any object which implements the ApiRationObjectInterface is automatically converted to json.
More tests
JsonRequest - the simple way to work with Request
If you need to create a JsonLd response for the creation operation, try:
If you need to create a JsonLd response for an update operation, try ResourceUpdatedJsonLdResponse.
How to make JsonLd Response (hydra:Collection)
CollectionJsonLdResponse is automatically support pagination:
Notice: symfony 6.3 is supports similar features, but the bundle supports more functionality, for example, responding to an invalid request by throwing a BadRequestException:
and the client will receive the response with the status 400:
More examples.
Installation on PHP 7
Add as a requirement in your composer.json
file or run for prod:
Installation on PHP 8
Add as a requirement in your composer.json
file or run for prod:
As dev:
Dev
Debug tests:
If you need php8: `
Cs-Fixer:
Update phpmd rules:
CORS (Optional functionality)
If the library doesn't work, try to add the following lines to services.yml:
All versions of apiration-bundle with dependencies
yapro/marker-interfaces Version *
symfony/event-dispatcher Version *
symfony/http-foundation Version *
symfony/http-kernel Version *
symfony/translation Version *
symfony/polyfill-php80 Version ^v1.25.0
symfony/validator Version *
laminas/laminas-code Version *
yapro/helpers Version *
symfony/serializer-pack Version *