v3 - Resolver error - Cannot read property '1' of undefined
See original GitHub issueThis error occured when we upgraded to swagger ui 3.x.
We use swagger-ui-dist@3.0.18.
The issue can be reproduced with the following swagger-spec on Swagger Editor:
# this is an bug report spec
swagger: '2.0'
info:
title: Swagger UI 3 Bug Report
description: |
This will display the following error:
## Resolver error
`Cannot read property '1' of undefined`
version: 1.0.0
host: localhost
schemes:
- https
basePath: /v1
produces:
- application/json
paths:
/resolver-error:
get:
tags:
- Bug Report
responses:
200:
description: The trouble maker
schema:
$ref: '#/definitions/foo-bar'
definitions:
foo-bar:
allOf:
- $ref: '#/definitions/baz'
- properties:
data:
type: array
items:
$ref: '#/definitions/foo'
foo:
allOf:
- $ref: '#/definitions/bar'
- properties:
foo:
type: string
bar:
properties:
bar:
type: string
foo:
$ref: '#/definitions/foo'
baz:
properties:
baz:
type: string
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (8 by maintainers)
Top Results From Across the Web
No operations defined in spec! && Resolver error Cannot read ...
The "/api/category" path is missing the "get": node that would wrap the GET operation definition. It should look like this: "paths" ...
Read more >Solved: Editor full of resolver errors - SmartBear Community
Now I revisited our API and it happens to be full of errors of this type: Resolver error. Cannot read property 'properties' of...
Read more >Uncaught TypeError: Cannot read property '1' of undefined
This error is because there is a property field in that model, on that form that doesn't have his generic value defined, probably...
Read more >[SOLVED] Cannot Read Property of Undefined in JavaScript
The “cannot read property of undefined” error occurs when you attempt to access a property or method of a variable that is undefined...
Read more >Solved: Error when integrating Custom API: Cannot read pro...
Solved: Hi, when Integrating the following custom API i get the Error: Cannot read property 'parameters' of undefined. Same happens when I use...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’m happy to report that Swagger UI v3.12.0 (presumably this specific fix: https://github.com/swagger-api/swagger-ui/pull/4273) now correctly resolves two examples above that were previously failing with
Resolver error: Cannot read property '<prop>' of undefined(https://github.com/swagger-api/swagger-ui/issues/3366#issuecomment-366096404 and https://github.com/swagger-api/swagger-ui/issues/3366#issuecomment-366565475)@stoutfiles if hiding the error is all want, try a custom css: