[WIP] open api 3 spec dynamic generation #1
[WIP] open api 3 spec dynamic generation #1stefanorosanelli wants to merge 22 commits intomasterfrom
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.
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.
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-apiOutput format:
application.jsonin requestapplication/x-yamlas content typeProblems: to get an
in browserresponse and avoid errors a brutal check inHtmlMiddlewarehas been done - to be improved.Some endpoints like
admin/ormodel/will be implemented later.