Code Monkey home page Code Monkey logo

Comments (11)

cnizzardini avatar cnizzardini commented on July 24, 2024 1

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?

I agree here.

from cakephp-swagger-bake.

cnizzardini avatar cnizzardini commented on July 24, 2024 1

Okay, this will be faster if you submit PR for these items.

from cakephp-swagger-bake.

segy avatar segy commented on July 24, 2024

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.

cnizzardini avatar cnizzardini commented on July 24, 2024

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.

segy avatar segy commented on July 24, 2024

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.

cnizzardini avatar cnizzardini commented on July 24, 2024

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.

cnizzardini avatar cnizzardini commented on July 24, 2024

Also, curious why you cannot use setters?

from cakephp-swagger-bake.

segy avatar segy commented on July 24, 2024

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.

cnizzardini avatar cnizzardini commented on July 24, 2024

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.

cnizzardini avatar cnizzardini commented on July 24, 2024

https://github.com/cnizzardini/cakephp-swagger-bake/releases/tag/v2.5.5

from cakephp-swagger-bake.

segy avatar segy commented on July 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.