Skip to content

Add interfaces and custom data#37

Open
FandaOG wants to merge 23 commits into
vyuldashev:masterfrom
FandaOG:master
Open

Add interfaces and custom data#37
FandaOG wants to merge 23 commits into
vyuldashev:masterfrom
FandaOG:master

Conversation

@FandaOG

@FandaOG FandaOG commented Mar 2, 2021

Copy link
Copy Markdown

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

FandaOG commented Mar 2, 2021

Copy link
Copy Markdown
Author

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

@FandaOG

FandaOG commented Mar 2, 2021

Copy link
Copy Markdown
Author

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

@FandaOG

FandaOG commented Oct 12, 2021

Copy link
Copy Markdown
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants