Comments (4)
Looks like this needs to be cleaned up: https://github.com/cnizzardini/cakephp-swagger-bake/blob/master/src/Lib/Operation/ExceptionResponse.php#L73
from cakephp-swagger-bake.
By reading the stack trace closer I think I have uncovered the problem.
When the OpenApiPathGenerator
scans the controller docblock for my PagesController it picks up the several @throws
annotations that are put there by default:
/**
* Displays a view
*
* @param string ...$path Path segments.
*
* @return \Cake\Http\Response|null
* @throws \Cake\Http\Exception\ForbiddenException When a directory traversal attempt.
* @throws \Cake\View\Exception\MissingTemplateException When the view file could not
* be found and in debug mode.
* @throws \Cake\Http\Exception\NotFoundException When the view file could not
* be found and not in debug mode.
* @throws \Cake\View\Exception\MissingTemplateException In debug mode.
*/
#[Route('/pages/*', 'pages:display', resource: false)]
public function display(string ...$path): ?Response
{ ... }
I'm guessing the path scanner tries to instantiate these exceptions as objects, which it cannot do for the MissingTemplateException
because it doesn't have the required parameter, thus the crash.
Indeed, if I comment out the @throws
lines (there are two) for the MTE the crash disappears.
from cakephp-swagger-bake.
I will run a manual test before doing a release on this, but probably not today.
from cakephp-swagger-bake.
https://github.com/cnizzardini/cakephp-swagger-bake/releases/tag/v2.5.7
from cakephp-swagger-bake.
Related Issues (20)
- OpenApiResponse annotation doesn't work properly with schemaType: 'array' and ref. HOT 4
- OpenApiSchemaProperty(name: 'propert_name', type: 'array') not working
- Logic of Configuration class HOT 11
- Feature Query: is it possible to hide model properties? HOT 4
- Backport fix from 5.x branch
- Throw tags taking precedence over OpenApiResponse attribute
- collection generation HOT 3
- Undefined array key "securitySchemes" in Cakaphp 4.15 version HOT 2
- Undefined array key "securitySchemes" HOT 10
- Cannot make controller working HOT 3
- Prevent loading associations in ApiResponse(associations: $var) HOT 10
- Up-port 2.5.9 to 3.0.1
- [InvalidArgumentException] Invalid yml: `/config/swagger.yml
- SwaggerBake Schema and SwaggerBake Routes executes even when hotReload is false HOT 6
- OpenApiSchemaProperty support array of objects HOT 11
- Hidden properties displaying in OpenAPI Schema
- Invalid Enum Syntax
- Missing schema - Cakephp 5 with Plugins HOT 5
- When using plugin with / in the name, plugin paths are skipped HOT 1
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 cakephp-swagger-bake.