-
Notifications
You must be signed in to change notification settings - Fork 10
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
[AsyncAPI] NullPointerException in MapperContentUtil.java #271
Comments
HI @gaby-roland, Looks like you found a hole in our AsyncApi specification support. I'll check it and provide a solution ASAP. Cheers |
HI @gaby-roland, I provide a fix in a branch attached to this issue. Do you mind test if it works for you? Cheers |
Hi @gaby-roland, |
@jemacineiras Sure! Here is my plugin configuration in my pom.xml <plugin>
<groupId>com.sngular</groupId>
<artifactId>scs-multiapi-maven-plugin</artifactId>
<version>${scs.multiapi.maven.plugin.version}</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>asyncapi-generation</goal>
</goals>
<configuration>
<specFiles>
<specFile>
<filePath>${asyncapi.spec}</filePath>
<consumer>
<apiPackage>${project.groupId}.demo.generated.api.consumer</apiPackage>
<modelPackage>${project.groupId}.demo.generated.types</modelPackage>
</consumer>
<supplier>
<apiPackage>${project.groupId}.demo.generated.api.producer</apiPackage>
<modelPackage>${project.groupId}.demo.generated.types</modelPackage>
</supplier>
</specFile>
</specFiles>
</configuration>
</execution>
</executions>
</plugin> |
Thanks, I found strange this part |
Yeah I think that's because I just don't have any |
Yes, that was the problem. But I think I found the key, do you mind testing this fix? |
With the latest changes, it seems like the asyncapi: "2.0.0"
info:
title: Demo API
version: "1.0.0"
channels:
user/signedup:
subscribe:
operationId: emitUserSignUpEvent
message:
$ref : '#/components/messages/UserSignedUp'
publish:
operationId: onUserSignUp
message:
$ref: '#/components/messages/UserSignedUp'
components:
messages:
UserSignedUp:
name: userSignedUp
title: User signed up event
summary: Inform about a new user registration in the system
contentType: application/json
payload:
$ref: '#/components/schemas/userSignedUpPayload'
schemas:
userSignedUpPayload:
type: object
properties:
firstName:
type: string
description: "foo"
lastName:
type: string
description: "bar"
email:
type: string
format: email
description: "baz"
createdAt:
type: string
format: date-time
someOtherObject:
type: object
properties:
property1:
type: string
property2:
type: integer |
I keep getting
NullPointerException
errors originating inMapperContentUtil
.Specifically, line 390.
It looks like on the last line in the snippet,
value.get(REF)
is null, which explains why a few line before it there is aif (value.has(REF))
, but this check is not taken into consideration on 390 andvalue.get(REF)
is assumed to be non-null.I saw this error whenever I try have an object nested inside another object, for example in the yaml below,
someOtherObject
is nested inside ofuserSignedUpPayload
:This causes the following error:
The text was updated successfully, but these errors were encountered: