Questions tagged [fosrestbundle]

A Symfony 2 plugin by FriendsOfSymfony (FOS) which provides various tools to rapidly develop RESTful API's with Symfony 2.

A Symfony 2 bundle by FriendsOfSymfony (FOS) which provides various tools to rapidly developer RESTful API's with Symfony 2.

Its features include:

  • A View layer to enable output and format agnostic Controllers
  • A custom route loader to generate url's following REST conventions
  • Accept header format negotiation including handling for custom mime types
  • RESTful decoding of HTTP request body and Accept headers
  • Exception controller for sending appropriate HTTP status codes

Links:

803 questions
0
votes
1 answer

REST Services For FOSRestBundle

I am Using FOSRestBundle For REST Services. Its Working fine . How can I Set the services for NewAction,UpdateAction,EditAction and DeleteAction For an Entity..? I didn't get any idea from the doc from github. Please Help me Thanks in advance
Nisam
  • 2,275
  • 21
  • 32
0
votes
1 answer

What's the correct version of FOSRestBundle to use with Symfony 2.0.18?

I'm trying to upgrade my Symfony2 application from 2.0.16 to 2.0.18. I ran into something that looked like a FOSRestBundle problem, so I upgraded FOSRestBundle too (to their latest commit on their master branch), but that seems to cause different…
Adam Monsen
  • 9,054
  • 6
  • 53
  • 82
0
votes
2 answers

Using http request headers with Symfony routing to return different content (html / json)

I'm working on a REST API using the FOSRestBundle and I'd like to be able to use the same URL for returning HTML and JSON depending on the request Accept header; i.e. if you call the URL directly from a browser (Accept : text/html etc) HTML is…
greg
  • 6,853
  • 15
  • 58
  • 71
-1
votes
1 answer

Symfony 5 dynamic routing resolve

I am migrating legacy project routing (Yii1) to Symfony 5 Right now my config/routing.yaml looks something like this: - {path: '/login', methods: ['GET'], controller: 'App\Controller\RestController::actionLogin'} - {path: '/logout', methods:…
Justinas
  • 41,402
  • 5
  • 66
  • 96
-1
votes
1 answer

Symfony - Prefix all my routes with a version

Hi I would like to version my API. So I would like t prefix my roote with a version. like that? # config/routes/annotations.yaml controllers: resource: ../../src/Controller/ type: annotation prefix: name: '{version}' It works…
Kevin
  • 4,823
  • 6
  • 36
  • 70
-1
votes
2 answers

Get my clients with only today's appointments

i'm not used to develop with Symfony, I retrieved an old project which has to be improved. Here is my problem : In back-end, I have clients with several appointments (HasMany), or none. In front-end, from my rest api call, I receive the clients…
-1
votes
1 answer

Symfony 3 - Should I create two different controllers for REST and normal HTML?

Symfony 3 - Should I create two different controllers for REST and normal HTML? I already have a web application where I am using Symfony controller and twig html templates. So I already have the business logic written to fetch the content. Now I…
Rahul Sonar
  • 69
  • 1
  • 3
-1
votes
2 answers

Cannot send data with HttpClient, Angular 4 with Symfony backend

Solved by using NelmioCorsBundle. I'm using angular 4.3.3 for frontend and Symfony3 for backend, and I use FosRestBundle also. In Angular, and I'm working with HttpClient to send or request some data. Requesting data is working good and I can…
hous
  • 2,577
  • 2
  • 27
  • 66
-1
votes
2 answers

Is there a way to create error with Fosrestbundle without using form and validation?

I mean creating an error 400, 500 generated by the ViewHandler of Fosrestbundle directly from the controller without using an Entity and a Form.
speeeeeed2006
  • 21
  • 1
  • 5
-1
votes
1 answer

FOSRestBundle does not set the _format parameter

I have the following configuration: fos_rest: view: view_response_listener: 'force' formats: json: true xml: true html: false body_listener: decoders: json:…
Bertuz
  • 2,390
  • 3
  • 25
  • 50
-1
votes
1 answer

Best practices for request parameters in GET/POST methods in Symfony

What is the best practices for request a number of parameters in API URL and request a specific type for that. For example I have the url: http://host/my_api/?param_1=p1¶m_2=p2 Now I have in parameters.yml a parameter that say how many…
user6216601
-1
votes
1 answer

Send and Recive data as Array to API using FOSRestBundle

Hi I use FOSRestBundle to create my API. I have to send data as ARRAY like: "sender"=>array("name"=>"adm","city"=>"Rz") and more. I read documentation and I didn't know how to recive data array! My function: /** *…
marczak
  • 489
  • 2
  • 8
  • 17
-1
votes
1 answer

Argument 1 passed to x must be an instance of y, string given,

I try to execute a post request, but it shows me this error Argument 1 passed to x::addPhoto() must be an instance of y, string given, this argument in my case is the current authenticated user, i use this code to have it: $user=…
anony
  • 185
  • 2
  • 14
-1
votes
1 answer

Cannot write property %name% to an array. Maybe you should write the property path as %name% instead?

I have use FosRestBundle and i want to save entity with embedded information: Parent entity: class ServiceOffer { use ORMBehaviors\SoftDeletable\SoftDeletable; /** * @var PriceLevel * *…
-1
votes
1 answer

Symfony2 FOSREST JMS\Serializer bundles error

Can you help to fix the following error? InvalidArgumentException: "fos_rest.serializer" must implement FOS\RestBundle\Serializer\Serializer (instance of "JMS\Serializer\Serializer" given). in…
Ndb
  • 11
  • 4
1 2 3
53
54