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
2
votes
1 answer

Symfony 4.4 / NelmioApiDocBundle 4.0.1 Issue with Annotations

A similar question is already out, but with a different versioning on Symfony and NelmioApiDoc. And I am not sure it is this combination or that fact that also I am using FesRestBundle on top. My issue is the following: I do get the following error…
2
votes
2 answers

The annotation "@Swagger\Annotations\Response" in method was never imported

I have a problem with fresh install of Swagger and FosRestBundle on Symfony 5 app. I have this error : [Semantical Error] The annotation "@Swagger\Annotations\Response" in method ... was never imported. Did you maybe forget to add a "use" statement…
Romaixn
  • 36
  • 1
  • 8
2
votes
1 answer

"@Sensio\Bundle\FrameworkExtraBundle\Configuration\Route" in method ... does not exist, or could not be auto-loaded"

i'm upgrading symfony's version from 2.8 to 3.0.9, and after fixing the errors with some library's versions and other problems, i have tried run the command "php bin/console cache:clear" with problems: C:\inetpub\wwwroot\360forfuture>php bin/console…
2
votes
1 answer

Assets not loaded

I have problem, my assets not loaded - 404 Not Found "nelmio/api-doc-bundle": "^3.6@dev" I executed php bin/console assets:install and php bin/console assets:install --symlink Locally works, but on the test server don't works... could someone know…
shuba.ivan
  • 3,824
  • 8
  • 49
  • 121
2
votes
1 answer

How to use normalizer option in Symfony constraints component

The documentation https://symfony.com/doc/4.4/reference/constraints/Length.html#normalizer states that This option allows to define the PHP callable applied to the given value before checking if it is valid. For example, you may want to pass the…
inkrot
  • 448
  • 5
  • 12
2
votes
0 answers

Symfony 4 Fos Rest : Error 415 Unsupported Media Type

Impossible to create a new event, I always get 415 error I test with postman, if I test the same endpoint with ParamConverter annotation, I can reach the function. So the error should come from configuration Here is my controller
barden
  • 349
  • 6
  • 18
2
votes
1 answer

Rest-bundle of Symfony 4 requires config in 4.3 version, while Symfony 4 uses 5.0

Following this tutorial I tried to configure REST API on fresh new Symfony 4 install. The first step in the tutorial is doing: composer create-project symfony/skeleton rest_api_project Followed by composer require…
PolGraphic
  • 3,233
  • 11
  • 51
  • 108
2
votes
1 answer

Allow controller action in symfony access cotrol

I have an API project in Symfony. Authentication is secured by the JWT token. I want to allow 2 actions in the controller which can be used without login users. /point/{param}/elmeter /point/{param}/measurement I tried to allow in security.yaml…
Tomas
  • 49
  • 1
  • 7
2
votes
0 answers

Invalid xml message received when post data xml includes DOCTYPE

I've for a REST endpoint that will be accepting a POST in the form of XML. Currently it's throwing an "Invalid xml message received" in vendor/friendsofsymfony/rest-bundle/EventListener/BodyListener.php (line 115) when it attempts to decode the…
RustedBucket
  • 23
  • 1
  • 5
2
votes
0 answers

Symfony 4: Getting additional exception data to the template

I am working on an Symfony + FOSRestBundle based REST API. I have implemented (extended) custom HttpException class which is being used in case of validation errors. Along the error message I always pass an array with detailed data about validation…
user1257255
  • 1,161
  • 8
  • 26
  • 55
2
votes
3 answers

Unknown Entity namespace alias 'AppBundle' and "Class 'App\\Entity\\Product' does not exist

I'm trying to implement FOSRestBundle so I've just created my first class controller.
Benny
  • 116
  • 3
  • 8
2
votes
0 answers

API - Successive calls

I'm working on an API (with Symfony) and I have a question for you : I have a method to create something (let's take a car for example) I have another method to create something else (let's take a boat for example) Now in my first method (create a…
Jérémy S.
  • 141
  • 2
  • 2
  • 10
2
votes
4 answers

symfony4, FOSRestBundle and ramsey/uuid-doctrine - convert uuid object to string for REST API

I am using symfony4 for a while now and love it. Now I wanted to start with the FOSRestBundle and uuid from ramsey. No problems so far, eveything works fine, when I call the API I get an JSON response with the fields. The fields are: id, type:…
Marc
  • 45
  • 8
2
votes
1 answer

REST API: how to post a manytomany relationship with fosrestbundle

In my Symfony 4 project, I have 2 entities: Question and PossibleAnswer. A question can have many possible answers and an answer can be used in many different questions. I want to POST a question, I use FOSRestBundle. This is how I would format the…
manu
  • 1,059
  • 1
  • 16
  • 33
2
votes
1 answer

FOSRestBundle : ParamFetcher error

I'm Using FOSRestBundle for my project I've configured this route to have access to different kinf of data : ``` /** * @Rest\Get("") * * @Rest\QueryParam( * name="categoriesId", * requirements="[0-9a-zA-Z\-…
graille
  • 1,131
  • 2
  • 14
  • 33