Closed h4cc closed 6 years ago
Ok. I don't really know what "discrimator" is, so I suggest you to work on this feature :)
I made a small example with according JSON output: https://gist.github.com/h4cc/8313723
Doctrine MongoDB has also a discriminator feature, that works well in combination with jms. http://docs.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/reference/inheritance-mapping.html#single-collection-inheritance
My first idea would be, if its @ApiDoc{output="AbstractUser"}, all the "child" Classes like "User" and "Moderator" would be collected and (somehow) integrated in the "Return" part of the report. Or would there by a better way to display multiple possible return Entites? Till now only one type of Return seems to be assumed.
For output I think if we update the response to look something like the following it would work. http://swagger.wordnik.com/#!/pet/findPetsByStatus_get_1
In case the link does not work look at the findPetsByStatus API method and the response output it documents.
Ah, ok. The return format of the response in swagger might fit better. But that sounds to me like a different story, that has to be implemented first.
Although the swagger response does not make clear, that it could be multiple different response types like User and Moderator.
Hello,
Could you please review above pull requests?
I tested the feature branch and its working for my API. Like the HTML view with the tabs :+1:
@h4cc Thanks for you comment. Will it be possible then to merge this change or it needs further improvement?
As far as i can see, all needed functionality is given. The coding looks good and tests are available. :+1:
Unfortunately there is one issue. Required fields are not shown correctly with this solution.
i am closing old tickets without activity. feel free to open a new issue if needed.
We are using JMS\Discriminator for our Entities and would like to express that in the apidoc.
Currently, we can just use the Base Entity, that does not contain all the information :(
Would be a very cool feature, if it would be possible to introspect the discriminations and supply multiple input or output types in the documentation.