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

Throws error when a definition refers to self #104

Open
erichwelz opened this issue Jan 8, 2020 · 2 comments
Open

Throws error when a definition refers to self #104

erichwelz opened this issue Jan 8, 2020 · 2 comments

Comments

@erichwelz
Copy link

Given the schema below, swaggerValidator.init throws Cannot convert undefined or null to object

I believe the OAS 2.0 spec allows definitions to self-reference.

{
	"swagger": "2.0",
	"definitions": {
		"RecursiveObject": {
			"type": "object",
			"properties": {
				"StringProperty": {
					"type": "string"
				},
				"subItems": {
					"type": "array",
					"items": {
						"$ref": "#/definitions/RecursiveObject"
					}
				}
			}
		}
	}
}
@kobik
Copy link
Collaborator

kobik commented Apr 13, 2020

Thanks for reporting @erichwelz.

I'll have a look at this.

@astrolemonade
Copy link

I experienced this too. Can you have a look, please?

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

No branches or pull requests

3 participants