You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Field name "entries" in a schema causes swagger-ui javascript error and fails to load #6016
The openapi definition below has a schema with a field name called "entries". This causes the ui to throw a javascript error "e.entries is not a function" (see the screenshot below).
This behavior only started Friday May 15th 2020 at around 15:00 CET. Before that swagger-ui had no problems loading a schema containing a field called entries, so I am assuming something changed in the bundle I use from the url above.
changed the title [-]Field name "entries" in a model causes swagger-ui javascript erro and fails to load[/-][+]Field name "entries" in a schema causes swagger-ui javascript erro and fails to load[/+]on May 17, 2020
changed the title [-]Field name "entries" in a schema causes swagger-ui javascript erro and fails to load[/-][+]Field name "entries" in a schema causes swagger-ui javascript error and fails to load[/+]on May 17, 2020
We found the issue is likely related to this change, where swagger fragments with an entries field are interpreted as a FormData object and swagger-ui attempts to invoke entries().
I have a question about this change. The change has been merged but the error still occurs when using petstore. Is there another repository that needs to adopt swagger before using 'entries' as a parameter works when rendering?
Activity
[-]Field name "entries" in a model causes swagger-ui javascript erro and fails to load[/-][+]Field name "entries" in a schema causes swagger-ui javascript erro and fails to load[/+][-]Field name "entries" in a schema causes swagger-ui javascript erro and fails to load[/-][+]Field name "entries" in a schema causes swagger-ui javascript error and fails to load[/+]provegard commentedon May 18, 2020
Specifying version 3.25.2 (I'm using unpkg, I assume jsdelivr.net supports that too) fixes the problem.
jmmolina796 commentedon May 18, 2020
Actually I have the same error:
When I type the field name entries, I received a message saying: "Unable to render this definition".
I need to write entries as a field since my API requires this name.
If I change entries to entry, it works as expected.
Can someone help me with this problem, why it fails when I use entries as a field name?
vivvooren commentedon May 19, 2020
I have the same problem with Version 3.23.3
stiliyan commentedon May 19, 2020
We found the issue is likely related to this change, where swagger fragments with an entries field are interpreted as a FormData object and swagger-ui attempts to invoke
entries().Exiting early when entries is not a function should resolve this.
jlsjonas commentedon May 20, 2020
Looks like this is caused by #5999
tim-lai commentedon May 20, 2020
@mke1ms @jlsjonas @stiliyan @jmmolina796 Thanks for reporting with details and suggestions! A fix is incoming and will be included in the next release.
RSkorina commentedon May 20, 2020
I have a question about this change. The change has been merged but the error still occurs when using petstore. Is there another repository that needs to adopt swagger before using 'entries' as a parameter works when rendering?
tim-lai commentedon May 20, 2020
@RSkorina A new release of SwaggerUI will make this change visible on petstore.swagger.io
katsisaac50 commentedon Mar 14, 2023
Your API definition is missing the OpenAPI/Swagger version number, in this case "swagger": "2.0" . Add it at the beginning, like so:
{
"swagger": "2.0",
"title" : "Music API Documentation",
...
this worked for me, details on https://copyprogramming.com/howto/swagger-unable-to-render-this-definition-the-provided-definition-does-not-specify-a-valid-version-field?utm_content=cmp-true