-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding OpenApi Schema Properties on Models #930
Conversation
This reverts commit f27e3b5
Please try to reduce (remove) all unrelated codestyle changes, hard to digest exactly what you're adding |
…Annotations Generation
# Conflicts: # src/Console/ModelsCommand.php
I removed the codestyle changes. |
As I'm not using OpenApi, it's hard to digest how this works. Before having to write a test, can you share some examples how it works, what's the model look like before/after? |
Here is the official OpenAPI 3 Schema Specification
As you can see, I am adding the |
My gut feeling: this doesn't belong into this ide-helper ; rather it could be a plugin (*) for ide-helper, because that's really a outside-laravel-framework use-case and depends on a third party package. (*) there is no dedicated "plugin" support, rather I'm meaning some kind of hack/integration/workaround Just my 2c, I don't feel this "3rd party dependency special case" belongs into the library. |
But I would be all for it allowing other pacakges to easily hook into ide-helper to provide their additional logic |
Yeah, your perspective looks fair enough, but this plugin is already doing a great job and re-inventing the wheel in order to do an additional thing looks not smart. Having a hooking/attaching an other plugin into that and allow other plugin vendors to extend it's functionalities sounds a wonderful idea. |
Probably a good to ping @barryvdh what he things :-) |
I understand that it kinda makes sense if you're doing much of the same logic already. But not sure if it's in scope for this project. And OpenAPI doesn't always map directly to a model, does it? |
Models are converted to OpenAPI Schemas and then they can used as $ref into the rest of the API-Spec (as request body, response, etc.) |
I firmly believe this shouldn't be in this package as it's very narrow focused. Rather it can live in your code base or a package based on this, providing an adjusted command which hooks into the places where you need the modifications. But as already mentioned, I would be all-in ensuring this is technically possible. |
It's a very initial implementation, in order to work in the same way it should also be extended into the ReflectionClass package to support it from this site better.