Monday, January 11, 2016

How to specify default format for FOS\RestBundle to json

In src/apibundle/Resources/config/routing.yml with yaml configuration

api:
    type:     rest
    resource: "@APIBundle/Resources/config/routing.yml"
    defaults: {_format: json} 
    prefix:   /api

No comments:

Post a Comment