Comments (7)
Hi !
This is an interesting one ! Well I guess this would be quite easy to implement. PathMethodBuilder
would need a little cleaning up to easily extend it. Would you want to also set the builder as a general setting or is it for a specific route in your case ?
Do you have anything "core" that could be added in for everyone ? Could you share what is missing for you ?
Thanks,
from openapi-php-attributes.
I'm mocking up something in a PR (not a solution) to give you an idea.
from openapi-php-attributes.
One more note, it was difficult to make it run with a Laravel, so I had to bootstrap app differently:
Artisan::command('openapi-generate', function () {
$files = Symfony\Component\Finder\Finder::create()
->files()
->name('*.php')
->in([app_path('PublicApi/v2')]);
foreach ($files as $autoload) {
include_once $autoload->getPathName();
}
$generate = \OpenApiGenerator\Generator::create()->generate();
echo json_encode($generate, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
});
It would be great if class names could be passed as an argument of Generator::create()
(or generate
method) that way I could decide how to fetch those classes instead of relying on get_declared_classes()
function.
from openapi-php-attributes.
Ok I get the idea, thanks for the PR. I'll try some stuff and will come back to you with a proposition.
For the class list as a command argument, I'm not totally sure because you can already specify the path (or paths) to your controller(s).
from openapi-php-attributes.
I understand that specifying paths is only an option if you are using the tool as a CLI rather than as a library. That's okay, I can find another solution to that problem.
from openapi-php-attributes.
Ok so after several months, I managed to find some time to work on a solution -- hopefully you are still using this lib.
So, I refactored the HttpGenerator (it needed to be done anyway) and added a dynamic builder as you suggested on this commit 8df02e0
I'd like your input on wether it was what you were expecting
from openapi-php-attributes.
Hah, thanks for considering it. Yes, I still want to use this library. I will try to play around with this version and make it work.
from openapi-php-attributes.
Related Issues (11)
- why not publish this package in packagist? HOT 1
- path-parms thats not a function-param? HOT 3
- Using ref Property HOT 5
- Undefined array key "security" HOT 1
- invalid output/json
- invalid securityScheme HOT 2
- Different outputs generated on different systems HOT 2
- Allow BackedEnums for OpenApiGenerator\Attributes\Property HOT 2
- Require mandatory fields but omit empty optional fields HOT 1
- Error when not defined `Server` attribute
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openapi-php-attributes.