dist/admin/async~mountEditor.min.js problem in Vanilla 3.1

After upgrading to 3.1 (from 2.8.3 to 3.0.2 to 3.1), I noticed that the Dashboard->Settings->Technical->APIv2 page wasn't working... just showing the message "No API definition provided." The actual API URLs were working (i.e. /vanilla/api/v2/xxxx).

It appears that the file: dist/admin/async~mountEditor.min.js

in 3.1 is referencing /api/v2/open-api/v3, which doesn't work.

If I change the reference in async~mountEditor.min.js to /api/v2/open-api/v2, the problem is resolved and I can see the normal API calls on this page. I doubt that this is the correct solution, but I don't know much about the internals of Vanilla.

Comments

  • charrondevcharrondev Application Developer (PHP, JS) Montreal Vanilla Staff

    Vanilla 3.1 definitely ships with an /api/v2/open-api/v3 endpoint. See the controller here:

    Do you have a particular error when trying to access that endpoint?

  • {

      "message": "/api/v2/open-api/v3 not found.",

      "status": 404,

      "description": null

    }

  • charrondevcharrondev Application Developer (PHP, JS) Montreal Vanilla Staff

    Could you share me the contents of your /dashboard/controllers/api/OpenApiApiController ?

  • Looks like the install of 3.1 left the old file there too in dashboard/controllers... and I don't see anything in the upgrade notes that say to remove it.

  • There seems to be some extra things in plugins/swagger-ui in my installed tree vs. the dist files:


    [email protected]:~/dist/tmp$ ls -al /var/www/html/vanilla/plugins/swagger-ui/

    total 76

    drwxr-xr-x 6 www-data www-data 4096 Apr 23 18:07 .

    drwxr-xr-x 30 www-data www-data 4096 Aug 15 16:05 ..

    -rw-r--r-- 1 www-data www-data  466 Aug 16 13:05 addon.json

    -rw-r--r-- 1 www-data www-data  50 Sep 24 2018 .babelrc

    drwxr-xr-x 2 www-data www-data 4096 Sep 24 2018 design

    drwxr-xr-x 2 www-data www-data 4096 Aug 16 13:38 js

    drwxr-xr-x 5 www-data www-data 4096 Apr 23 18:07 src

    -rw-r--r-- 1 www-data www-data 34054 Aug 16 13:05 swagger.png

    -rw-r--r-- 1 www-data www-data 1337 Aug 16 13:05 SwaggerUIPlugin.php

    drwxr-xr-x 3 www-data www-data 4096 Apr 23 18:07 views

    -rw-r--r-- 1 www-data www-data  365 Aug 16 13:05 yarn.lock

    [email protected]:~/dist/tmp$ ls -al package/plugins/swagger-ui/

    total 64

    drwxr-xr-x 4 ed ed 4096 Jul 10 16:28 .

    drwxr-xr-x 30 ed ed 4096 Jul 10 16:28 ..

    -rw-r--r-- 1 ed ed  466 Jul 10 16:28 addon.json

    drwxr-xr-x 4 ed ed 4096 Jul 10 16:28 src

    -rw-r--r-- 1 ed ed 34054 Jul 10 16:28 swagger.png

    -rw-r--r-- 1 ed ed 1337 Jul 10 16:28 SwaggerUIPlugin.php

    drwxr-xr-x 3 ed ed 4096 Jul 10 16:28 views

    -rw-r--r-- 1 ed ed  365 Jul 10 16:28 yarn.lock

Sign In or Register to comment.