Use Config in favor of manual bean creation.

The Bean can be created in doWithSpring.

However, it currently does not seem to work with the 'showRestApi'
action.
Replace manager clause with dependsOn.
Bean updates onConfigChange .

The Bean updates on config change.

Bean takes default values.

Config is validated.
Updated REAMDE.
Removed presumptuous hard-coding.

The field that was removed assumed that the application is going to use
JaxRS's default /api path, however the application should be allowed to
use whatever paths it so desires.

By removing it here and adding it in the annoation, not only does it
provide better flexibility for applications, but that is also how JaxRS
does it as well.

For example, if the config field is set to [ '/v1' ], now both the @Api
and @Path annoations for swagger and JaxRS respectively will look the
same.
Lean away from grails.serverURL .

According to the Grails 2.x documentation, the behavior of the Config
grails.serverURL has changed behavior with respect to environments.

This Config also appears more associated with createLink and redirect
methods.

I have changed the code to not use grails.serverURL at all, but rather
to use the grailsLinkGenerator bean within the controller.

Anomaly: Assuming your production server is "http://sudofu.me" and you
have a grails app that uses the grails.serverURL config for this plugin,
the behavior between grails run-app and deploying WAR changes.

In run-app, the serverURL is respected and the plugin appears to work
fine. However, when WAR'd, the
"${grailsApplication.config.grails.serverURL}/api-docs" value in the
showRestApi view actually produces the following:

http://sudofu.me/sudofu.me/api-docs

In other words, it appends the hostname an additional time, and
therefore the api-docs link is not readable.

By leaning away from the grails.serverURL, the behavior is consistent
between both run methods.

Caveat: The link generated by the grailsLinkGenerator bean has different
states. At first I had placed this in the
Swagger4jaxrsGrailsPlugin.groovy file, however that lead to the address
being:

http://localhost:8080/

Rather than the expected:

http://localhost:8080/MyApp/

As it turns out, the grailsLinkGenerator is not reliably fully
initialized until the application is running. Therefore, I had to
migrate this configuration for the swaggerConfig bean into the
showRestApi controller, so that the address is consistent across run
methods.

I also explicitly pass this root address to the index.gsp view, as that
is the cleanest way to do so.