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

Fix java.lang.NullPointerException and remove stack trace output from ModelResolver #4793

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

reta
Copy link
Contributor

@reta reta commented Nov 20, 2024

The latest Swagger Core 2.2.26 raises java.lang.NullPointerException and prints the stack trace into the console while attempting to introspect if the type is a record or not:

java.lang.NullPointerException: Cannot invoke "com.fasterxml.jackson.databind.introspect.AnnotatedMember.getDeclaringClass()" because the return value of "com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getPrimaryMember()" is null
	at io.swagger.v3.core.jackson.ModelResolver.isRecordType(ModelResolver.java:1131)
	at io.swagger.v3.core.jackson.ModelResolver.extractGenericTypeArgumentAnnotations(ModelResolver.java:1109)
	at io.swagger.v3.core.jackson.ModelResolver.addGenericTypeArgumentAnnotationsForOptionalField(ModelResolver.java:1104)
	at io.swagger.v3.core.jackson.ModelResolver.resolve(ModelResolver.java:865)
	at io.swagger.v3.core.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:97)
	at io.swagger.v3.core.jackson.ModelResolver.resolve(ModelResolver.java:751)
	at io.swagger.v3.core.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:97)
	at io.swagger.v3.core.jackson.ModelResolver.resolve(ModelResolver.java:751)
	at io.swagger.v3.core.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:97)
	at io.swagger.v3.core.jackson.ModelResolver.resolve(ModelResolver.java:751)
	at io.swagger.v3.core.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:97)
	at io.swagger.v3.core.converter.ModelConverters.resolveAsResolvedSchema(ModelConverters.java:192)
	at io.swagger.v3.jaxrs2.Reader.parseMethod(Reader.java:1168)
	at io.swagger.v3.jaxrs2.Reader.parseMethod(Reader.java:956)
	at io.swagger.v3.jaxrs2.Reader.read(Reader.java:502)
	at io.swagger.v3.jaxrs2.Reader.read(Reader.java:642)
	at io.swagger.v3.jaxrs2.Reader.read(Reader.java:199)
	at io.swagger.v3.jaxrs2.Reader.read(Reader.java:228)
	at io.swagger.v3.oas.integration.GenericOpenApiContext.read(GenericOpenApiContext.java:693)
	at io.swagger.v3.jaxrs2.integration.resources.BaseOpenApiResource.getOpenApi(BaseOpenApiResource.java:51)
	at io.swagger.v3.jaxrs2.integration.resources.OpenApiResource.getOpenApi(OpenApiResource.java:32)

@reta
Copy link
Contributor Author

reta commented Nov 20, 2024

@frantuma would appreciate if you could take a look, thank you!

@frantuma frantuma merged commit 3d619b3 into swagger-api:master Nov 20, 2024
6 checks passed
@frantuma
Copy link
Member

Thanks!

ndwlocatieservices added a commit to ndwnu/nls-accessibility-map that referenced this pull request Dec 19, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [nu.ndw.nls.locationdataissuesapi:client-feign](https://dev.azure.com/ndwnu/NLS/_git/nls-location-data-issues) ([source](https://dev.azure.com/ndwnu/NLS/_git/nls-location-data-issues)) | compile | patch | `1.0.14` -> `1.0.15` |
| nu.ndw.nls.geojson.geometry:specification |  | patch | `1.3.5` -> `1.3.8` |
| nu.ndw.nls.geojson.geometry:specification-open-api-config |  | patch | `1.3.5` -> `1.3.8` |
| nu.ndw.nls.geojson.geometry:geometry-model | compile | patch | `1.3.5` -> `1.3.8` |
| nu.ndw.nls.geojson.geometry:specification | compile | patch | `1.3.5` -> `1.3.8` |
| nu.ndw.nls.geojson.geometry:geometry-jts | compile | patch | `1.3.5` -> `1.3.8` |
| [nu.ndw.nls:routing-map-matcher-library](https://github.com/ndwnu/nls-routing-map-matcher) | compile | minor | `13.2.4` -> `13.3.0` |
| [io.swagger.core.v3:swagger-annotations](https://github.com/swagger-api/swagger-core) | compile | patch | `2.2.26` -> `2.2.27` |

---

### Release Notes

<details>
<summary>swagger-api/swagger-core (io.swagger.core.v3:swagger-annotations)</summary>

### [`v2.2.27`](https://github.com/swagger-api/swagger-core/releases/tag/v2.2.27): Swagger-core 2.2.27 released!

[Compare Source](swagger-api/swagger-core@v2.2.26...v2.2.27)

-   fix: swagger-api/swagger-ui#10220 ([#&#8203;4806](swagger-api/swagger-core#4806))
-   Fix for record component annotations on fields with JsonProperty annotations ([#&#8203;4795](swagger-api/swagger-core#4795))
-   Fix java.lang.NullPointerException and remove stack trace output from ModelResolver ([#&#8203;4793](swagger-api/swagger-core#4793))
-   Move applySchemaResolution check to a method ([#&#8203;4791](swagger-api/swagger-core#4791))
-   feat(gradle-plugin): enable lazy evaluation, implicit task dependencies and fixing `setEncoding` ([#&#8203;4761](swagger-api/swagger-core#4761))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or PR is renamed to start with "rebase!".

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
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