New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entity form types breaks the documentation #94
Comments
Might be related to this one #59 ? |
Can you paste the full stack trace? |
|
Bug confirmed here too.. Same issue.. Form working fine in controller, having troubles in the docs |
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. |
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. |
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? |
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/ |
Since the entity (and maybe others) form field type breaks the doc generations, I've added a try{} catch{} exception handler when you try to a compatible field type in the formParser(). It's a workaround for issue nelmio#94. Later we can add a better support for other types of fields.
I have a method with the following annotation:
The ProductApiCreateType form looks like this:
Whenever the documentation is generated, the following exception is thrown:
I haven't been able to work around this - any thoughts?
The text was updated successfully, but these errors were encountered: