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

API Docs Preview: x.slice is not a function #748

Open
bpeterm opened this issue Apr 30, 2019 · 6 comments
Open

API Docs Preview: x.slice is not a function #748

bpeterm opened this issue Apr 30, 2019 · 6 comments
Labels

Comments

@bpeterm
Copy link

bpeterm commented Apr 30, 2019

Hello,

When I'd like to Preview Documentation, I show this error:

Something went wrong...
x.slice is not a function
Stack trace
TypeError: x.slice is not a function
    at Object.matchGrammar (https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:55:26236)
    at Object.tokenize (https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:55:26564)
    at Object.highlight (https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:55:25251)
    at at (https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:108:31856)
    at t.render (https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:114:76644)
    at ji (https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:83:62905)
    at Ai (https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:83:62700)
    at Ri (https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:83:66534)
    at Ha (https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:83:90551)
    at Va (https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:83:90935)

ReDoc Version: 2.0.0-rc.4
Commit: 0dab8af

There's no Issues in the editor.

Thanks,
Peter

@bpeterm
Copy link
Author

bpeterm commented Apr 30, 2019

There was a wrong multipart/form-data example of a POST operation.
It cannot be in JSON format, just in bulk text format.

@EricWittmann
Copy link
Member

This sounds like a bug in ReDoc. Do you agree?

@bpeterm
Copy link
Author

bpeterm commented May 2, 2019

This sounds like a bug in ReDoc. Do you agree?

It can be JSON format in multipart/form-data example? I didn't find in specification...

@EricWittmann
Copy link
Member

Can you include a simple OpenAPI document that reproduces the problem?

@EricWittmann EricWittmann changed the title x.slice is not a function API Docs Preview: x.slice is not a function May 3, 2019
@EricWittmann
Copy link
Member

Just following up on this - @bpeterm can you supply a reproducer for this?

@paflov
Copy link

paflov commented Apr 20, 2020

I had the same problem. Reproduction and workaround is easy:

This:

        "201":
          description:  OK, started
          content:
            text/plain:
              example: 1

causes the error, but this

        "201":
          description:  OK, started
          content:
            text/plain:
              example: "1"

works.

Redoc "2.0.0-rc.22"

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

No branches or pull requests

3 participants