Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APIs do not load documentation when withCompare set to false #879

Closed
wouthoekstra opened this issue May 7, 2020 · 2 comments
Closed

APIs do not load documentation when withCompare set to false #879

wouthoekstra opened this issue May 7, 2020 · 2 comments
Labels
bug fixed on dev for issues fixed on dev branch

Comments

@wouthoekstra
Copy link

wouthoekstra commented May 7, 2020

Describe the bug

Only the titles of the APIs load, nothing of the actual docs. The console logs the following error, so I guess it has something to do with SemVer:

semver.min.js?v=1588867787213:1 Uncaught (in promise) TypeError: Invalid Version: undefined
    at new K (semver.min.js?v=1588867787213:1)
    at K.compare (semver.min.js?v=1588867787213:1)
    at ir (semver.min.js?v=1588867787213:1)
    at Object.vr [as lte] (semver.min.js?v=1588867787213:1)
    at HTMLElement.<anonymous> (main.js:561)
    at Function.each (jquery.min.js?v=1588867787213:2)
    at k.fn.init.each (jquery.min.js?v=1588867787213:2)
    at setMainVersion (main.js:556)
    at init (main.js:586)
    at Object.active (main.js:61)

Steps to reproduce

  • All the APIs are documented with @apiversion 2.0.0
  • withCompare is set to false. If set to true, the docs do work.

Information

  • Version of apidoc: 0.22.1 (but also tried to downgrade to 0.18.0, which uses an older SemVer)
  • Operating system (e.g. GNU+Linux/MacOS/Windows): Linux for generating. Windows for testing.
  • Browser (e.g. firefox, chrome): Chrome / Brave / Edge
  • Too make life a little easier: the broken docs are in the attachment.
    broken_docs.zip
  • The configuration from package.json: (slightly modified to not clutter this issue)
    "apidoc": {
    "name": "Our name",
    "title": "Our title",
    "version": "2.0.0",
    "description": "lorem ipsum",
    "url": "url to our domain",
    "template": {
    "forceLanguage": "en",
    "withGenerator": false,
    "withCompare": false
    },
    "order": [
    ...(list of all the APIs here)
    ],
    "header": {
    "title": "General",
    "filename": "header.md"
    }
    }
@wouthoekstra
Copy link
Author

Sorry, I see literally the last issue before mine reports the same thing: #878

I did not notice, because at first I did not know the issue was with withCompare. I'll leave my issue open, because I think it might have some additional info to resolve the bug.

@rafaelgomesxyz
Copy link
Contributor

It's not SemVer, the version is retrieved from the HTML, but the HTML containing the version isn't inserted with the option set to false. I'll make a PR soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fixed on dev for issues fixed on dev branch
Projects
None yet
Development

No branches or pull requests

3 participants