-
Notifications
You must be signed in to change notification settings - Fork 2
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
[WIP] open api 3 spec dynamic generation #1
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1 +/- ##
=======================================
Coverage 100% 100%
- Complexity 5 27 +22
=======================================
Files 2 3 +1
Lines 19 96 +77
=======================================
+ Hits 19 96 +77
Continue to review full report at Codecov.
|
*/ | ||
'OATemplates' => [ | ||
'paths' => [ | ||
'/{$resource}/{id}' => [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how can we deal with special endpoints like admin
and model
, where $resource
does not match exactly endpoint path? for instance: /admin/:op/:id
. Would we accept $resource
= 'admin/:op'
, or should we use some other pattern to handle these special endpoints?
however, it's fine for now, as long as we are dealing with roles
and streams
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, we could introduce a {$prefix}
and have something like /{$prefix}{$resource}/{id}
or use separate files like admin_endpoint.php
without templates.
It depends on how consistent the API structure will be, hopefully a lot 😉
Codecov Report
@@ Coverage Diff @@
## master #1 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 5 27 +22
===========================================
Files 2 3 +1
Lines 19 96 +77
===========================================
+ Hits 19 96 +77
Continue to review full report at Codecov.
|
URL to create dynamic spec is:
/tools/open-api
Output format:
application.json
in requestapplication/x-yaml
as content typeProblems: to get an
in browser
response and avoid errors a brutal check inHtmlMiddleware
has been done - to be improved.Some endpoints like
admin/
ormodel/
will be implemented later.