grape-swagger
grape-swagger copied to clipboard
Support for inheritance: subTypes and discriminator.
Hello, is there any support for describing inheritance in the generated swagger specification? According to Swagger 1.2 specification, this should be possible through the use of subTypes and discriminator.
I have an API that retrieves/updates account information. The Account model is abstract and I have concrete BusinessAccount and IndividualAccount models (they have some of the fields in common).
What options do I have for achieving this? I would like input to be validated according to the type of account and output to only present the fields pertaining to the type of account at hand (for output I use grape-entity).
Regards, Dan
This is currently not supported => feature request.
I have noticed that the Swagger 2.0 specification has changed a little bit in respect of how inheritance is described. Are there any plans to move to 2.0 in the near future?
See https://github.com/tim-vandecasteele/grape-swagger/issues/219 - I'd really like https://github.com/tim-vandecasteele/grape-swagger/issues/137 first.