Comments (11)
The second thing. I'd suggest changing the code here: https://github.com/cnizzardini/cakephp-swagger-bake/blob/master/src/Lib/Service/OpenApiControllerService.php the way, that the
Configuration
(possibly passed as the first parameter) will be passed to the constructor ofSwaggerFactory
. Do you agree?
I agree here.
from cakephp-swagger-bake.
Okay, this will be faster if you submit PR for these items.
from cakephp-swagger-bake.
The second thing. I'd suggest changing the code here: https://github.com/cnizzardini/cakephp-swagger-bake/blob/master/src/Lib/Service/OpenApiControllerService.php the way, that the Configuration
(possibly passed as the first parameter) will be passed to the constructor of SwaggerFactory
. Do you agree?
from cakephp-swagger-bake.
On the first item, did you try this: https://github.com/cnizzardini/cakephp-swagger-bake#extending-views-and-controllers
So you should just be able to create a templates/plugin/SwaggerBake
directory and add the templates in there. Is there a reason to not use this approach?
from cakephp-swagger-bake.
On the first item, did you try this: https://github.com/cnizzardini/cakephp-swagger-bake#extending-views-and-controllers
So you should just be able to create a
templates/plugin/SwaggerBake
directory and add the templates in there. Is there a reason to not use this approach?
I know, but I'd like to do this in another plugin, and I'm not sure, how this does work. Otherwise you can probably need to change any other behavior of the Configuration class and this problem will still be there, so seems logical to me to change these properties to protected. If not, than probably do some other logic for processing the configuration. What do you think?
from cakephp-swagger-bake.
I do wonder if its better to create a ConfigurationInterface and leave the current as is. This would require changing some method signatures and I don't know if it will actually solve your issue. In general, I don't like extension.
from cakephp-swagger-bake.
Also, curious why you cannot use setters?
from cakephp-swagger-bake.
but this a feature in the constructor. so you pass no config, it fetches from SwaggerBake config and then sets the properties (and fails as described above). How would you change this to use setters?
from cakephp-swagger-bake.
It could accept ConfigurationInterface
, which would be implemented by an optional ConfigurationImplementationTrait
and then you would pass in your own instance of ConfigurationInterface
which would do your things.
It's a bit more work than I want to do on this library though since I am mainly hoping to just do minor things outside of maintaining compatibility with cake, php, and openapi.
from cakephp-swagger-bake.
https://github.com/cnizzardini/cakephp-swagger-bake/releases/tag/v2.5.5
from cakephp-swagger-bake.
I understand, but still... this is much more simple to extend the class so why make it "nicer" but harder. Thanks for merging it!
from cakephp-swagger-bake.
Related Issues (20)
- OpenApiSchemaProperty(name: 'propert_name', type: 'array') not working
- Feature Query: is it possible to hide model properties? HOT 4
- Backport fix from 5.x branch
- Too few arguments to function Cake\View\Exception\MissingTemplateException::__construct(), 0 passed HOT 4
- 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
- Make touching swagger.json file optional (or at least don't do it during bootstrapping) 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.