Uploaded image for project: 'Magnolia REST Framework'
  1. Magnolia REST Framework
  2. MGNLREST-202

Update the REST tools module to include a more recent version of swagger (to benefit from swagger bug fixes)

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Neutral Neutral
    • None
    • 1.1
    • tools
    • None

      The REST tools module (version 1.1.1) uses an old version of swagger-ui (although I cannot see the version specified in the source code.)

      This old version relies on the shred javascript library. This version of the library contains a bug which means that the basePath attribute cannot be a relative url when the rest tools are served from a non standard port (See https://github.com/pandastrike/shred/issues/60).

      In newer versions of swagger-ui, the shred library is no longer used for ajax requests, and it is possible to use swagger with a relative base path (this is something we have done in other projects - see attached screenshot.)

      We think it is useful to be able to use a relative basePath if need be, as the port/ full url that Magnolia will run on is not always known before start up, and therefore cannot always be managed by .properties files.

      We have managed to get the swagger ui working in magnolia if we set the relative base path (e.g. "/.rest") and hotfix the shred.bundle.js rest-tools resource as shown in the attachment. This proves that everything should work fine if swagger-ui was updated, or the dependency fixed.

        Acceptance criteria

              Unassigned Unassigned
              mnuttall Mike Nuttall
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD