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

How to use FOSRestBundle manual routes with CRUD from Symfony2?

I am using the FOSRestBundle to create a REST application but since REST features is only a part, I am also using some of Symfony2 built-in automation tools to generate my CRUD code. Everything works fine but I am unable to correctly map the route…
Paul A.
  • 577
  • 2
  • 11
  • 24
0
votes
1 answer

Symfony2 FOSRestBundle: Demands an Array But Cannot Parse it in config.yml

I'm using the friendsofsymfony/rest-bundle": "1.0.*@dev" bundle, trying to upgrade from Symfony 2.2 to Symfony 2.3. In my app/config/config.yml file, I'm trying to specify rules for the fos_rest format_listener: fos_rest: view: formats: …
A. Duff
  • 4,097
  • 7
  • 38
  • 69
0
votes
0 answers

How to have complete result with Doctrine/Symfony2

I had trouble formulating the title of my question. Apologies for that. I have a OneToMany association between "Catalog" and "Category". I also have a self referencing bidirectional association on Category (since a category can contain multiple…
Michael Villeneuve
  • 3,933
  • 4
  • 26
  • 40
0
votes
2 answers

FOSRestBundle: Returning JSON/XML meta data for "Bad Credentials" Exception

I'm using FOSRestBundle for my REST API and so far it has been a great tool. I use HTTP Basic Auth and in most of the cases it works just fine. However, I have problems with the bundle's exception behaviour when bad credentials are submitted. When…
MichaelB
  • 465
  • 6
  • 16
0
votes
1 answer

not route found error while creating parameterize restful webservice

i am using symfony 2.2.3 with FOSRestBundle to implement Restful webservices. here is my code but when i fire following url i am getting following error No route found for "GET /business/john" here is the controller code use…
Hunt
  • 8,215
  • 28
  • 116
  • 256
0
votes
0 answers

How to handle different data type for same property for a HTTP or REST API

I work on a web application using AngularJS for the frontend and the backend for Symfony2. I want to make a web service so I can have a one page app. I am wondering about how I should handle the data exchange between the two layers. Consider this…
Frank6
  • 1,193
  • 1
  • 11
  • 23
0
votes
2 answers

FOSRestBundle routings - error when adding parent option

I have an issue with FOSRestBundle. I am trying to use the parent option in my routing and I get the following error [InvalidArgumentException] Every parent controller must have get{SINGULAR}Action($id) method where {SINGULAR} is a singular…
0
votes
2 answers

Symfony2 Fos Rest showing url , giving 500 in logs

app/console router:debug shows get_test_helloworld GET /test/helloworld.{_format} but on hitting this url, nothing is displayed and in logs i get [2013-06-08 02:38:44] request.ERROR:…
amitchhajer
  • 12,492
  • 6
  • 40
  • 53
0
votes
2 answers

Cannot import resource error, FosRestBundle Throws InvalidArgumentException

Hello i have a strange problem, while using FostRestBundle. First error is : InvalidArgumentException: Every parent controller must have get{SINGULAR}Action($id) method where {SINGULAR} is a singular form of associated object And the second one…
Canser Yanbakan
  • 3,780
  • 3
  • 39
  • 65
0
votes
1 answer

OAuth access token for internal calls

I'm currently tyring to build an API driven symfony2 web applicaiton.Just a basic application to learn symfony2 and REST. It would be based on a RESTful api. Calls to the API will be authenticated using OAuth. For e.g.: if a client application wants…
Ankit Khedekar
  • 924
  • 1
  • 7
  • 26
0
votes
1 answer

Send user ID along with any REST API call?

I am building an application with symfony2 + FosRestBundle in backend and angularjs in frontend. It is a single page application. Backend and client (consuming data from rest api/backend) are on the same server. After login the user is able to…
DarkLeafyGreen
  • 69,338
  • 131
  • 383
  • 601
0
votes
1 answer

FOSRestBundle View annotation not working

config.yml: fos_rest: param_fetcher_listener: true body_listener: true format_listener: default_priorities: [json, xml] view: view_response_listener: 'force' sensio_framework_extra: view: { annotations:…
user1236048
  • 5,542
  • 7
  • 50
  • 87
0
votes
1 answer

REST POST no data?

I am trying to create a REST service with Symfony2. I followed a few articles, and got the GET functions working; I am able to fetch a list of my objects, or a specific one. But saving my object to the database with a POST doesn't work. I am using…
rolandow
  • 1,049
  • 1
  • 15
  • 28
0
votes
1 answer

Set 'parameters' annotation in NelmioApiDocBundle

I create an API RESTfull using Symfony2.1 with FOSRESTBundle and I am using NelmioApiDocBundle to generate automatic documentation. I have a PUT request in which the user should send one parameter, but I don't need to create a Form for this purpose.…
Fernando P. G.
  • 191
  • 2
  • 15
0
votes
1 answer

FOSRestBundle no key-value in JSON

I've set up FOSRestBundle with my small Symfony2 website. I've created some small GET methods and when I visit the api url, I get my JSON data. Perfect. But I'm trying to build an iphone app and I use RestKit for mapping/parsing json/... The…
Jesse
  • 879
  • 1
  • 12
  • 26