Giter VIP home page Giter VIP logo

Comments (8)

phidah avatar phidah commented on May 17, 2024

Might be related to this one #59 ?

from nelmioapidocbundle.

Seldaek avatar Seldaek commented on May 17, 2024

Can you paste the full stack trace?

from nelmioapidocbundle.

phidah avatar phidah commented on May 17, 2024
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.

alex88 avatar alex88 commented on May 17, 2024

Bug confirmed here too.. Same issue.. Form working fine in controller, having troubles in the docs

from nelmioapidocbundle.

alex88 avatar alex88 commented on May 17, 2024

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.

alex88 avatar alex88 commented on May 17, 2024

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.

bzitzow avatar bzitzow commented on May 17, 2024

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.

wesgood avatar wesgood commented on May 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.