laravel-openapi icon indicating copy to clipboard operation
laravel-openapi copied to clipboard

Add interfaces and custom data

Open FandaOG opened this issue 4 years ago • 3 comments

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.

FandaOG avatar Mar 02 '21 08:03 FandaOG

I've added interfaces because in PHP you can not have multiple class extends but you can have multiple interfaces.

FandaOG avatar Mar 02 '21 08:03 FandaOG

There is an extension of this library using this pull request: https://github.com/FandaOG/laravel-openapi-value-object

FandaOG avatar Mar 02 '21 12:03 FandaOG

@vyuldashev I've forgot to fix formatting. Could you accept this PR?

FandaOG avatar Oct 12 '21 07:10 FandaOG