springfox / springfox-grails-integration

SpringFox integration with Grails 3.x
Apache License 2.0
19 stars 13 forks source link

grails 3.3.1 #21

Open ibmsoft opened 6 years ago

ibmsoft commented 6 years ago

current ,can not use in grails 3.3.1, is there any solution?

dilipkrish commented 6 years ago

Yes, planning to work on it in the next couple weeks

ibmsoft commented 6 years ago

any progress?

dilipkrish commented 6 years ago

Yeah. I'm currently stuck at a point where Im no as familiar with grails. Im getting a message asking me to first initialize the gorm context before I can introspect domain classes. If you could provide insight that will be much appreciated.

ibmsoft commented 6 years ago

may be you can do something in plugin eg: void doWithApplicationContext() { // TODO Implement post initialization spring config (optional) }

dilipkrish commented 6 years ago

Not very familiar with grails internals, but thanks for the tip. I pushed a PR #22 with work in progress to solicit help. I'll look into it for sure.

krishnact commented 6 years ago

You need to start the plugin after GORM has been initialized. The solution is to set autostartup to false using this stanza in application.yaml:

springfox:
    documentation:
      auto-startup : false

In your Bootstrap.groovy, get a bean reference to the plugin and start it from init.

class BootStrap {
// springfox bean
DocumentationPluginsBootstrapper documentationPluginsBootstrapper;

    def init = { servletContext ->
        // Lets start springfox bean
        documentationPluginsBootstrapper.start()
        // Other initialization code
        //
        //
    }
    def destroy = {
    }
}
dilipkrish commented 6 years ago

There is a PR #23, I plan to merge in soon. Thanks for your suggestion!

TabbyC commented 5 years ago

Any update on getting that PR merged?

hemantseth0210 commented 5 years ago

@dilipkrish Do you have plan to merge the PR#23 anytime soon?

gabivis commented 4 years ago

Same question, Any plans to merge PR #23?