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

[Issue 2048] NullPointerException in SchemaProcessor.processArraySchema() #2049

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

garydgregory
Copy link
Contributor

@garydgregory garydgregory commented Jan 23, 2024

Issue: #2048
PR: #2049

Caused by: java.lang.NullPointerException: Cannot invoke
"io.swagger.v3.oas.models.media.Schema.get$ref()" because "items" is
null
	at io.swagger.v3.parser.processors.SchemaProcessor.processArraySchema(SchemaProcessor.java:218)
	at io.swagger.v3.parser.processors.SchemaProcessor.processSchemaType(SchemaProcessor.java:69)
	at io.swagger.v3.parser.processors.SchemaProcessor.processPropertySchema(SchemaProcessor.java:139)
	at io.swagger.v3.parser.processors.SchemaProcessor.processSchemaType(SchemaProcessor.java:76)
	at io.swagger.v3.parser.processors.SchemaProcessor.processSchema(SchemaProcessor.java:61)
	at io.swagger.v3.parser.processors.ComponentsProcessor.processSchemas(ComponentsProcessor.java:231)
	at io.swagger.v3.parser.processors.ComponentsProcessor.processComponents(ComponentsProcessor.java:145)
	at io.swagger.v3.parser.OpenAPIResolver.resolve(OpenAPIResolver.java:73)
        ...

The above is from a log and I don't have a easy way to create a reproducer. You'll notice though that most call sites of ArraySchema.getItems() in this repo do check for a null result value, but not all call sites.

"io.swagger.v3.oas.models.media.Schema.get$ref()" because "items" is
null swagger-api#2048

PR for:
```
Caused by: java.lang.NullPointerException: Cannot invoke
"io.swagger.v3.oas.models.media.Schema.get$ref()" because "items" is
null
	at io.swagger.v3.parser.processors.SchemaProcessor.processArraySchema(SchemaProcessor.java:218)
	at io.swagger.v3.parser.processors.SchemaProcessor.processSchemaType(SchemaProcessor.java:69)
	at io.swagger.v3.parser.processors.SchemaProcessor.processPropertySchema(SchemaProcessor.java:139)
	at io.swagger.v3.parser.processors.SchemaProcessor.processSchemaType(SchemaProcessor.java:76)
	at io.swagger.v3.parser.processors.SchemaProcessor.processSchema(SchemaProcessor.java:61)
	at io.swagger.v3.parser.processors.ComponentsProcessor.processSchemas(ComponentsProcessor.java:231)
	at io.swagger.v3.parser.processors.ComponentsProcessor.processComponents(ComponentsProcessor.java:145)
	at io.swagger.v3.parser.OpenAPIResolver.resolve(OpenAPIResolver.java:73)
        ...
```
The above is from a log and I don't have a easy way to create a
reproducer. You'll notice though that most call sites of
`ArraySchema.getItems()` in this repo do check for a null result value,
but not _all_ call sites.
@garydgregory garydgregory changed the title [Issue 2048] NullPointerException: Cannot invoke [Issue 2048] NullPointerException in SchemaProcessor.processArraySchema() Jan 23, 2024
@gracekarina gracekarina self-assigned this Jan 30, 2024
@gracekarina gracekarina merged commit d057528 into swagger-api:master Jan 30, 2024
6 checks passed
@garydgregory
Copy link
Contributor Author

garydgregory commented Jan 30, 2024

@gracekarina
TY!

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

Successfully merging this pull request may close these issues.

2 participants