spidey
API Platform
docs
DistributionAPI componentSchema componentAdmin componentScaffolding componentDeploymentGeneral Information
Screencasts
Demo
Resources
NewsLogosWallpapersColouring Webby
Community
OverviewContributorsEvents

Contribution guides

  1. API Platform Core Library
  2. API Platform Schema Generator
  3. API Platform Admin
  4. API Platform CRUD Generator

To report a security issue, please refer to the dedicated document.

JWT screencast
Watch the Contributing back to Symfony screencast (free-

You can also help us improve the documentation of this page.

TroubleshootingContributor Code of Conduct

The Distribution: Create Powerful APIs with Ease

  • Getting Started With API Platform: Create Your API and Your Jamstack Site!
    • Introduction
    • A Bookshop API
    • Installing the Framework
      • Using the API Platform Distribution (Recommended)
      • Using Symfony Flex and Composer
    • It's Ready!
    • Bringing your Own Model
    • Plugging the Persistence System
    • Validating Data
    • Adding GraphQL Support
    • The Admin
    • A Next.js Web App
    • Hooking Your Own Business Logic
    • Other Features
    • Screencasts
  • Testing the API
    • Creating Data Fixtures
    • Writing Functional Tests
    • Writing Unit Tests
    • Additional and Alternative Testing Tools
    • Using the API Platform Distribution for End-to-end Testing
  • Debugging
    • Xdebug
    • Add a Development Stage to the Dockerfile
    • Configure Xdebug with Docker Compose Override
    • Troubleshooting

The API Component

  • The API Platform Core Library
    • Features
    • Screencasts
  • Getting started
    • Installing API Platform Core
    • Before Reading this Documentation
    • Mapping the Entities
  • General Design Considerations
  • Extending API Platform
    • Doctrine Specific Extension Points
    • Leveraging the Built-in Infrastructure Using Composition
  • Testing Utilities
    • The Test HttpClient
    • API Test Assertions
    • HTTP Test Assertions
  • Operations
    • Enabling and Disabling Operations
    • Configuring Operations
    • Prefixing All Routes of All Operations
    • Expose a model without any routes
  • GraphQL Support
    • Enabling GraphQL
    • Changing Location of the GraphQL Endpoint
    • GraphiQL
      • Add another Location for GraphiQL
    • GraphQL Playground
      • Add another Location for GraphQL Playground
    • Modifying or Disabling the Default IDE
    • Request with application/graphql Content-Type
    • Operations
    • Queries
      • Global Object Identifier
      • Custom Queries
    • Mutations
      • Client Mutation Id
      • Custom Mutations
    • Subscriptions
      • Enable Update Subscriptions for a Resource
      • Subscribe
      • Receiving an Update
      • Subscriptions Cache
    • Workflow of the Resolvers
      • Disabling Resolver Stages
    • Events
    • Filters
      • Syntax for Filters with a List of Key / Value Arguments
      • Filtering on Nested Properties
    • Pagination
      • Using the Cursor-based Pagination
      • Using the Page-based Pagination
      • Disabling the Pagination
        • Globally
        • For a Specific Resource
        • For a Specific Resource Collection Operation
    • Security
    • Serialization Groups
      • Different Types when Using Different Serialization Groups
    • Exception and Error
      • Handling Exceptions and Errors (Logging, Filtering, ...)
      • Formatting Exceptions and Errors
        • Custom Exception Normalizer
    • Name Conversion
      • Nesting Separator
    • Custom Types
    • Modify the Extracted Types
    • Changing the Serialization Context Dynamically
    • Export the Schema in SDL
    • Handling File Upload
      • Configuring the Entity Receiving the Uploaded File
      • Resolving the File Upload
      • Using the createMediaObject Mutation
    • Change Default Descriptions
  • Data Providers
    • Custom Collection Data Provider
    • Custom Item Data Provider
    • Injecting the Serializer in an ItemDataProvider
    • Injecting Extensions (Pagination, Filter, EagerLoading etc.)
    • Community Data Providers
  • Data Persisters
    • Creating a Custom Data Persister
    • Decorating the Built-In Data Persisters
  • Filters
    • Doctrine ORM and MongoDB ODM Filters
      • Basic Knowledge
      • Search Filter
      • Date Filter
        • Managing null Values
      • Boolean Filter
      • Numeric Filter
      • Range Filter
      • Exists Filter
        • Using a Custom Exists Query Parameter Name
      • Order Filter (Sorting)
        • Comparing with Null Values
        • Using a Custom Order Query Parameter Name
      • Filtering on Nested Properties
      • Enabling a Filter for All Properties of a Resource
    • Elasticsearch Filters
      • Ordering Filter (Sorting)
        • Using a Custom Order Query Parameter Name
      • Match Filter
      • Term Filter
      • Filtering on Nested Properties
    • Serializer Filters
      • Group Filter
      • Property filter
    • Creating Custom Filters
      • Creating Custom Doctrine ORM Filters
        • Manual Service and Attribute Registration
      • Creating Custom Doctrine MongoDB ODM Filters
      • Creating Custom Elasticsearch Filters
      • Using Doctrine ORM Filters
    • ApiFilter Annotation
  • Subresources
    • Using Serialization Groups
    • Using Custom Paths
      • Access Control of Subresources
      • Limiting Depth
  • The Serialization Process
    • Overall Process
    • Available Serializers
    • The Serialization Context, Groups and Relations
      • Configuration
    • Using Serialization Groups
    • Using Serialization Groups per Operation
    • Embedding Relations
      • Normalization
      • Denormalization
      • Force IRI with relations of the same type (parent/childs relations)
    • Calculated Field
    • Changing the Serialization Context Dynamically
    • Changing the Serialization Context on a Per-item Basis
    • Name Conversion
    • Decorating a Serializer and Adding Extra Data
    • Entity Identifier Case
    • Embedding the JSON-LD Context
    • Collection Relation
  • Validation
    • Validating Submitted Data
    • Using Validation Groups
    • Using Validation Groups on Operations
    • Dynamic Validation Groups
    • Sequential Validation Groups
    • Error Levels and Payload Serialization
    • Validation on Collection Relations
    • Open Vocabulary Generated from Validation Metadata
    • Specification property restrictions
  • Security
    • Executing Access Control Rules After Denormalization
    • Hooking Custom Permission Checks Using Voters
    • Configuring the Access Control Error Message
    • Filtering Collection According to the Current User Permissions
    • Disabling Operations
    • Changing Serialization Groups Depending of the Current User
  • Content Negotiation
    • Configuring Formats Globally
    • Configuring PATCH Formats
    • Configuring Error Formats
    • Configuring Formats For a Specific Resource or Operation
    • Supporting Custom Formats
      • Reusing the API Platform Infrastructure
      • Contributing Support for New Formats
  • Pagination
    • Disabling the Pagination
      • Globally
      • For a Specific Resource
      • Client-side
        • Globally
        • For a specific resource
    • Changing the Number of Items per Page
      • Globally
      • For a Specific Resource
      • Client-side
        • Globally
        • For a Specific Resource
    • Changing Maximum items per page
      • Globally
      • For a Specific Resource
      • For a Specific Resource Collection Operation
    • Partial Pagination
      • Globally
      • For a Specific Resource
      • Client-side
        • Globally
        • For a Specific Resource
    • Cursor based pagination
    • Controlling the behavior of the Doctrine ORM Paginator
    • Custom Controller Action
  • Deprecating Resources and Properties (Alternative to Versioning)
    • Deprecating Resource Classes, Operations and Properties
    • Setting the Sunset HTTP Header to Indicate When a Resource or an Operation Will Be Removed
  • Overriding Default Order
  • Performance and Cache
    • Enabling the Built-in HTTP Cache Invalidation System
      • Extending Cache-Tags for Invalidation
    • Setting Custom HTTP Cache Headers
    • Enabling the Metadata Cache
    • Using PPM (PHP-PM)
    • Doctrine Queries and Indexes
      • Search Filter
      • Eager Loading
        • Max Joins
        • Fetch Partial
        • Force Eager
        • Override at Resource and Operation Level
        • Disable Eager Loading
      • Partial Pagination
    • Profiling with Blackfire.io
  • Extensions
    • Custom Doctrine ORM Extension
      • Example
        • Blocking Anonymous Users
    • Custom Doctrine MongoDB ODM Extension
    • Custom Elasticsearch Extension
  • Symfony Messenger Integration: CQRS and Async Message Processing
    • Installing Symfony Messenger
    • Dispatching a Resource through the Message Bus
    • Registering a Message Handler
    • Accessing the Data Returned by the Handler
    • Detecting Removals
    • Using Messenger with an Input Object
  • Using Data Transfer Objects (DTOs)
    • Specifying an Input or an Output Data Representation
    • Updating a Resource with a Custom Input
    • Disabling the Input or the Output
    • Per Operation input and output
    • Input/Output Metadata
    • Using Objects As Relations Inside Resources
    • Validating Data Transfer Objects
  • OpenAPI Specification Support (formerly Swagger)
    • Using the OpenAPI Command
    • Overriding the OpenAPI Specification
    • Using the OpenAPI and Swagger Contexts
    • Changing the Name of a Definition
    • Changing Operations in the OpenAPI Documentation
    • Changing the Location of Swagger UI
      • Disabling Swagger UI or ReDoc
      • Manually Registering the Swagger UI Controller
    • Using a custom Asset Package in Swagger UI
    • Overriding the UI Template
    • Compatibility Layer with Amazon API Gateway
    • OAuth
    • Info Object
  • JSON Schema Support
    • Generating a JSON Schema
    • Generating a JSON Schema Programmatically
    • Testing
  • Creating Async APIs using the Mercure Protocol
    • Installing Mercure Support
    • Pushing the API Updates
    • Dispatching Private Updates (Authorized Mode)
    • Available Options
  • Pushing Related Resources Using HTTP/2
  • Errors Handling
    • Converting PHP Exceptions to HTTP Errors
  • Using External Vocabularies
  • Operation Path Naming
    • Configuration
    • Create a Custom Operation Path Resolver
      • Defining the Operation Segment Name Generator
      • Registering the Service
      • Configuring It
  • Extending JSON-LD AND Hydra Contexts
    • JSON-LD
    • Hydra
  • Identifiers
    • Custom Identifier Normalizer
    • Changing Identifier in a Doctrine Entity
    • Supported Identifiers
  • MongoDB Support
    • Overview
    • Enabling MongoDB Support
    • Creating Documents
    • Filtering
    • Creating Custom Extensions
    • Adding Execute Options
  • Elasticsearch Support
    • Overview
    • Enabling Reading Support
    • Creating Models
      • Creating custom mapping
    • Filtering
    • Creating Custom Extensions
  • Creating Custom Operations and Controllers
    • Using Serialization Groups
    • Retrieving the Entity
    • Alternative Method
  • The Event System
    • Built-in Event Listeners
    • Custom Event Listeners
  • Handling File Upload
    • Installing VichUploaderBundle
    • Configuring the Entity Receiving the Uploaded File
    • Handling File Upload
    • Resolving the File URL
    • Making a Request to the /media_objects Endpoint
    • Linking a MediaObject Resource to Another Resource
  • JWT Authentication
    • Installing LexikJWTAuthenticationBundle
    • Configuring the Symfony SecurityBundle
      • Adding Authentication to an API Which Uses a Path Prefix
    • Documenting the Authentication Mechanism with Swagger/Open API
      • Configuring API Platform
      • Adding a New API Key
      • Adding endpoint to SwaggerUI to retrieve a JWT token
    • Testing
  • Accept application/x-www-form-urlencoded Form Data
    • Create your DeserializeListener Decorator
    • Creating the Service Definition
  • AngularJS Integration
    • Restangular
    • ng-admin
  • FOSUserBundle Integration
    • Installing the Bundle
    • Enabling the Bridge
    • Creating a User Entity with Serialization Groups
  • NelmioApiDocBundle Integration
  • Bootstraping the core library
  • Configuration

The Schema Generator Component

  • The Schema Generator
    • What Is Schema.org?
    • Why Use Schema.org Data to Generate a PHP Model?
      • Don't Reinvent the Wheel
      • Improve SEO and User Experience
      • Be Ready for The Future
    • Documentation
  • Getting Started
    • Installation
    • Model Scaffolding
      • Going Further
    • Cardinality Extraction
  • Configuration
    • Customizing PHP Namespaces
    • Forcing a Field Range
    • Forcing a Field Cardinality
    • Forcing a Relation Table Name
    • Forcing (or Disabling) a Class Parent
    • Forcing a Class to be Abstract
    • Forcing a Nullable Property
    • Forcing a Unique Property
    • Making a Property Read-Only
    • Making a Property Write-Only
    • Forcing a Property to be in a Serialization Group
    • Forcing an Embeddable Class to be Embedded
    • Author PHPDoc
    • Disabling Generators and Creating Custom Ones
    • Skipping Accessor Method Generation
    • Disabling the id Generator
    • Generating UUIDs
    • User submitted UUIDs
    • Generating Custom IDs
    • Disabling Usage of Doctrine Collections
    • Changing the Field Visibility
    • Generating @Assert\Type Annotations
    • Forcing Doctrine Inheritance Mapping Annotation
    • Interfaces and Doctrine Resolve Target Entity Listener
    • Custom Schemas
    • Checking GoodRelation Compatibility
    • PHP File Header
    • Full Configuration Reference

The Admin Component

  • The API Platform Admin
    • Features
  • Getting Started
    • Installation
    • Creating the Admin
  • Handling Relations
    • Embedded Relations
    • Display a Field of an Embedded Relation
    • Using an Autocomplete Input for Relations
  • Using the Schema.org Vocabulary
    • Displaying Related Resource's Name Instead of its IRI
    • Emails, URLs and Identifiers
  • Authentication Support
  • Handling File Upload
  • Performance
    • Retrieve All Relations in One Request
  • Customizing the Admin
    • Customizing the Admin's Main Page and the Resource List
    • Customizing the List View
    • Customizing the Show View
    • Customizing the Create Form
    • Customizing the Edit Form
    • Going Further
  • Components
    • Resource Components
      • AdminGuesser
      • ResourceGuesser
    • Page Components
      • ListGuesser
      • CreateGuesser
      • EditGuesser
      • ShowGuesser
    • Hydra
      • HydraAdmin
      • dataProvider
      • schemaAnalyzer
    • Other Components
      • Pagination
      • FieldGuesser
      • InputGuesser

The Client Generator Component

  • The API Platform Client Generator
    • Features
  • Next.js Generator
    • Install
      • Next + Express Server
      • Installing the Generator Dependencies
    • Generating Routes
    • Starting the Project
    • Screenshots
  • Nuxt.js Generator
    • Install
      • Nuxt
      • Installing the Generator Dependencies
    • Updating nuxtjs config
    • Generating Routes
    • Updating default layout
    • Starting the Project
    • Screenshots
  • Vuetify Generator
    • Install with Docker
    • Install without Docker
    • Generating the VueJS Web App
  • Quasar Framework Generator
  • React Generator
    • Install
    • Generating a Progressive Web App
    • Screenshots
  • React Native generator
    • Install
    • Generating a Native App
    • Screenshots in iOS Simulator
  • Vue.js Generator
  • TypeScript Interfaces
    • Example
  • Troubleshooting

Deployment

  • Deploying API Platform Applications
  • Deploying to a Kubernetes Cluster
    • Preparing Your Cluster and Your Local Machine
    • Creating and Publishing the Docker Images
    • Deploying
    • Initializing the Database
    • Tiller RBAC Issue
  • Deploying with Docker Compose
    • Installing the Docker Compose Setup for Production
    • Building and Pushing the Docker Images
    • Pulling the Docker Images and Running the Services
    • Running the Docker Compose Setup for Production Locally
  • Deploying an API Platform App on Heroku
  • Implement Træfik Into API Platform Dockerized
    • Basic Implementation
    • Known Issues
    • Going Further
    • Multiple Instances
    • More Generic Approach

General Information

  • API Platform's Philosophy
  • The Release Process
  • API Platform for Enterprise
    • Enterprise-ready open source software—managed for you
  • Security Policy
    • Reporting a Security Issue
    • Resolving Process
    • Security Updates With Tidelift
    • Issue Severity
      • Attack Complexity
      • Impact
      • Affected Projects
      • Score Totals
      • Severity levels
    • Credits
  • Troubleshooting
    • Using Docker
      • With Docker Toolbox on Windows
      • Error Starting The Web Server
    • Using API Platform and JMS Serializer in the same project
    • "upstream sent too big header while reading response header from upstream" NGINX 502 Error
  • Contribution guides
  • Contributor Code of Conduct
    • Our Pledge
    • Our Standards
    • Our Responsibilities
    • Scope
    • Enforcement
    • Attribution
spidey

Copyright © 2021 Kévin Dunglas

Sponsored by Les-Tilleuls.coop

Enterprise subscription - Security policy - Trademark policy

Code licensed under MIT, documentation under CC BY 3.0.

spidey
API Platform
Home
docs
DistributionAPI componentSchema componentAdmin componentScaffolding componentDeploymentGeneral Information
Screencasts
Demo
Resources
NewsLogosWallpapersColouring Webby
Community
OverviewContributorsEvents