laravel-openapi
laravel-openapi copied to clipboard
Add interfaces and custom data
With interfaces and custom data users can make their own factories.
It is possible to make general factory (for example MyGeneralParametersFactory).
This factory get custom data ["class"=>PetsParameter::class].
Then user's factory can do autogenerating schema depending on PetsParameter::class attributes.
User will have only few general factories (Parameter, Response...). Theses factories will get classes with attributes or it could be yaml file with schema definition and will autogenerates
final schema.
I've added interfaces because in PHP you can not have multiple class extends but you can have multiple interfaces.
There is an extension of this library using this pull request: https://github.com/FandaOG/laravel-openapi-value-object
@vyuldashev I've forgot to fix formatting. Could you accept this PR?