Nelmioapidocbundle: Empty output when providing the class

Created on 8 Feb 2017  路  4Comments  路  Source: nelmio/NelmioApiDocBundle

Hello,

I've just started to use this Bundle to generate my API docs, and although it works well I can see a problem (or at least it is from my side). Hope you can help.

My config.yml file is loading the by-default settings

nelmio_api_doc: ~

And my Symfony controllers are using the @ApiDoc annotation to generate the API documentation.

However, when I set-up the output value (to refer to a valid class) I'm not getting the output, just a message that says 200 - Returned when successful and no, that is not part of the status code responses, due I added them and they appear after the Return section:

output = "My\Awesome\Namespace\And\DTO\Class",

screen shot 2017-02-08 at 09 54 45

Do you know if there is a known issue that is causing this empty output, or how to fix it?

Just in case this is a blocker, I am using FOS Rest Bundle to generate my API endpoints.

Thanks for your time,

Most helpful comment

Hello,

I just realised I get an empty return when I provide a DTO. However when I provide my Doctrine entity then the bundle returns all properties and mapped entities, nested.

Is there a reason why it works using Doctrine entities but not using other PHP Classes?

Thanks,

All 4 comments

Hello,

I just realised I get an empty return when I provide a DTO. However when I provide my Doctrine entity then the bundle returns all properties and mapped entities, nested.

Is there a reason why it works using Doctrine entities but not using other PHP Classes?

Thanks,

Hello @DavidGarciaCat i run into the same problem.

When I use a Entity Class which is used with Doctrine, the output is rendered. If I just a simple Entity Class Object, which is not persisted with Doctrine, I get no output.

Did you find any solution already?

Hi @thbergler

The only way I have found for now - and I am not pleased to use this one - is setting my Serializer details using Yaml files instead of PHP annotations.

However, I think is sad when you report a bug like this (due the PHP annotation to serialise the content is working, just fails providing the API docs) and no one answers you...

Best regards,

unfortunately, nobody earns any money from spending time on this bundle, so we try to do what we can. if you can debug the issue and send a pull request to fix it, i am happy to review and merge it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andydandy80 picture andydandy80  路  4Comments

NicolasGuilloux picture NicolasGuilloux  路  4Comments

knyk picture knyk  路  6Comments

kojidev picture kojidev  路  6Comments

smuralidharan picture smuralidharan  路  3Comments