Skip to content

Hypermedia REST API for Symfony and Api Platform with JSON-LD and Hydra support

Notifications You must be signed in to change notification settings

20uf/DunglasApiBundle

 
 

Repository files navigation

DunglasApiBundle

DunglasApiBundle is an easy to use and powerful system to create hypermedia-driven REST APIs. It is a component of the Dunglas's API Platform framework and it can be used as a standalone bundle for the Symfony framework.

It embraces JSON for Linked Data (JSON-LD) and Hydra Core Vocabulary web standards.

Build a working and fully-featured CRUD API in minutes. Leverage the awesome features of the tool to develop complex and high performance API-first projects.

JSON-LD enabled Build Status SensioLabsInsight Dependency Status HHVM Status

Features

Here is the fully-featured REST API you'll get in minutes, I promise:

  • CRUD support through the API for Doctrine entities: list, GET, POST, PUT and DELETE
  • Hypermedia implementing JSON-LD
  • Machine-readable documentation of the API in the Hydra format, guessed from PHPDoc, Serializer, Validator and Doctrine ORM metadata
  • Human-readable Swagger-like documentation including a sandbox automatically generated thanks to the integration with NelmioApiDoc
  • Pagination (compliant with Hydra)
  • List filters (compliant with Hydra)
  • Validation using the Symfony Validator Component, with groups support
  • Errors serialization (compliant with Hydra)
  • Custom serialization using the Symfony Serializer Component, with groups support and the possibility to embed relations
  • Automatic routes registration
  • Automatic entrypoint generation giving access to all resources
  • \DateTime serialization and deserialization
  • FOSUserBundle integration (user management)
  • Easy installation thanks to API Platform

Everything is fully customizable through a powerful event system and strong OOP. This bundle is documented and tested with Behat (take a look at the features/ directory).

Screenshot of DunglasApiBundle integrated with NelmioApiDocBundle

Official documentation

  1. Getting Started
  2. Installing DunglasApiBundle
  3. Configuring the API
  4. Mapping the entities
  5. Registering the services
  6. NelmioApiDocBundle integration
  7. Operations
  8. Disabling operations
  9. Creating custom operations
  10. Data providers
  11. Creating a custom data provider
  12. Returning a paged collection
  13. Supporting filters
  14. Filters
  15. Search filter
  16. Date filter 1. Managing null values
  17. Order filter 1. Using a custom order query parameter name
  18. Enabling a filter for all properties of a resource
  19. Creating custom filters 1. Creating custom Doctrine ORM filters 2. Overriding extraction of properties from the request
  20. Serialization groups and relations
  21. Using serialization groups
  22. Annotations
  23. Embedding relations 1. Normalization 2. Denormalization
  24. Name conversion
  25. Entity identifier case
  26. Validation
  27. Using validation groups
  28. The event system
  29. Retrieving list
  30. Retrieving item
  31. Creating item
  32. Updating item
  33. Deleting item
  34. JSON-LD context builder
  35. Registering an event listener
  36. Resources
  37. Using a custom Resource class
  38. Controllers
  39. Using a custom controller
  40. FOSUserBundle integration
  41. Creating a User entity with serialization groups
  42. Using external (JSON-LD) vocabularies
  43. Performances
  44. Enabling the metadata cache
  45. AngularJS integration

Other resources

Credits

DunglasApiBundle is part of the API Platform project. It is developed by Kévin Dunglas, Les-Tilleuls.coop and awesome contributors.

About

Hypermedia REST API for Symfony and Api Platform with JSON-LD and Hydra support

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 61.7%
  • Gherkin 38.3%