Comments (8)
Might be related to this one #59 ?
from nelmioapidocbundle.
Can you paste the full stack trace?
from nelmioapidocbundle.
The required option "class" is missing.
in /var/www/pm/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/OptionsResolver.php at line 278
at OptionsResolver ->validateOptionsCompleteness (array())
in /var/www/pm/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/OptionsResolver.php at line 220
at OptionsResolver ->resolve (array())
in /var/www/pm/vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormType.php at line 115
at ResolvedFormType ->createBuilder (object(FormFactory), 'entity', array(), null)
in /var/www/pm/vendor/symfony/symfony/src/Symfony/Component/Form/FormFactory.php at line 87
at FormFactory ->createNamedBuilder ('entity', object(EntityType), null, array(), null)
in /var/www/pm/vendor/symfony/symfony/src/Symfony/Component/Form/FormFactory.php at line 67
at FormFactory ->createBuilder (object(EntityType), null, array(), null)
in /var/www/pm/vendor/symfony/symfony/src/Symfony/Component/Form/FormFactory.php at line 39
at FormFactory ->create (object(EntityType))
in /var/www/pm/src/Nelmio/ApiDocBundle/Parser/FormTypeParser.php at line 101
at FormTypeParser ->parseForm (object(Form))
in /var/www/pm/src/Nelmio/ApiDocBundle/Parser/FormTypeParser.php at line 76
at FormTypeParser ->parse ('Frisbee\ProductBundle\Form\Type\ProductApiCreateType')
in /var/www/pm/src/Nelmio/ApiDocBundle/Extractor/ApiDocExtractor.php at line 251
at ApiDocExtractor ->extractData (object(ApiDoc), object(Route), object(ReflectionMethod))
in /var/www/pm/src/Nelmio/ApiDocBundle/Extractor/ApiDocExtractor.php at line 94
at ApiDocExtractor ->all ()
in /var/www/pm/src/Nelmio/ApiDocBundle/Controller/ApiDocController.php at line 21
at ApiDocController ->indexAction ()
at call_user_func_array (array(object(ApiDocController), 'indexAction'), array())
in /var/www/pm/app/bootstrap.php.cache at line 1426
at HttpKernel ->handleRaw (object(Request), '1')
in /var/www/pm/app/bootstrap.php.cache at line 1390
at HttpKernel ->handle (object(Request), '1', true)
in /var/www/pm/app/bootstrap.php.cache at line 1566
at HttpKernel ->handle (object(Request), '1', true)
in /var/www/pm/app/bootstrap.php.cache at line 617
at Kernel ->handle (object(Request))
in /var/www/pm/web/api_dev.php at line 19
from nelmioapidocbundle.
Bug confirmed here too.. Same issue.. Form working fine in controller, having troubles in the docs
from nelmioapidocbundle.
Seems that skipping the Symfony\Bridge\Doctrine\Form\Type\EntityType in the parseForm method in FormTypeParser doesn't gives that exception, so the problem is with that type.
from nelmioapidocbundle.
I think that a fix for now is to set the entity field as string in the mapTypes, since most of the time in api calls client should enter some ID or string.
from nelmioapidocbundle.
Although this is no longer throwing an error, it appears the entity field type is still unsupported. Is there a link to another issue on this topic? IE: If that pull request was a temporary fix - is there an issue for a solution to support the entity field type?
from nelmioapidocbundle.
I think for APIs, you have to use a data transformer, as I presume normal Symfony forms include additional metadata for representing an entity in the form. I've had success with an "entity to ID" transformer, like the one at http://lrotherfield.com/blog/symfony2-forms-entity-as-hidden-field/
from nelmioapidocbundle.
Related Issues (20)
- More cases with false positive required properties HOT 3
- NullablePropertyProcessor fails with OA\Generator::UNDEFINED HOT 1
- [v4.18.0] Doc with attribute MapQueryParameter does not work with arrays HOT 1
- Orphaned MapQueryString schema since v4.18.0 HOT 2
- User Warning: Ignoring unexpected property "$ref" for @OA\Parameter() HOT 1
- I've update the bundle and I am getting the error below(Argument #2 ($area) must be of type string)
- Document multiple MapQueryString
- Missing array of array descriptor information HOT 1
- Bug Report - Incorrect Swagger Generation for Array Query Parameters HOT 1
- Describe dictionary
- [BUG] 🐛 `Multiple @OA\MediaType() with the same mediaType="application/json"` after `composer update -W` HOT 10
- [Symfony 7.1] support for Serialize attribute
- [Feature] Example property value HOT 1
- [Symfony 7.1] support for TypeInfo component
- NelmioApiDocBundle v5 overview HOT 1
- Duplicate schemas when referencing with `Attributes\Model` HOT 7
- Description from OpenApi\Attributes\QueryParameter is not processing HOT 2
- Properties with default values still get marked as required
- Converting tool is not available anymore HOT 1
- OpenAPI Specification Extensions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nelmioapidocbundle.