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 NullPointerException with oneOf discriminator change #49

Merged
merged 1 commit into from
Jun 7, 2018

Conversation

jmini
Copy link
Member

@jmini jmini commented Jun 7, 2018

While I was working on #29, I have found a NullPointerException:

java.lang.NullPointerException
	at com.qdesrame.openapi.diff.model.ChangedSchema.isChanged(ChangedSchema.java:76)
	at com.qdesrame.openapi.diff.model.Changed.isUnchanged(Changed.java:15)
	at com.qdesrame.openapi.diff.model.ChangedMediaType.isChanged(ChangedMediaType.java:23)
	at com.qdesrame.openapi.diff.model.Changed.isUnchanged(Changed.java:15)
	at com.qdesrame.openapi.diff.utils.ChangedUtils.isUnchanged(ChangedUtils.java:10)
	at com.qdesrame.openapi.diff.compare.ContentDiff.diff(ContentDiff.java:40)
	at com.qdesrame.openapi.diff.compare.RequestBodyDiff.computeDiff(RequestBodyDiff.java:61)
	at com.qdesrame.openapi.diff.compare.RequestBodyDiff.computeDiff(RequestBodyDiff.java:1)
	at com.qdesrame.openapi.diff.compare.ReferenceDiffCache.cachedDiff(ReferenceDiffCache.java:48)
	at com.qdesrame.openapi.diff.compare.RequestBodyDiff.diff(RequestBodyDiff.java:30)
	at com.qdesrame.openapi.diff.compare.OperationDiff.diff(OperationDiff.java:32)
	at com.qdesrame.openapi.diff.compare.PathDiff.diff(PathDiff.java:34)
	at com.qdesrame.openapi.diff.compare.PathsDiff.lambda$0(PathsDiff.java:59)
	at java.util.LinkedHashMap$LinkedKeySet.forEach(LinkedHashMap.java:559)
	at com.qdesrame.openapi.diff.compare.PathsDiff.diff(PathsDiff.java:39)
	at com.qdesrame.openapi.diff.compare.OpenApiDiff.compare(OpenApiDiff.java:94)
	at com.qdesrame.openapi.diff.compare.OpenApiDiff.compare(OpenApiDiff.java:67)
	at com.qdesrame.openapi.diff.OpenApiCompare.fromSpecifications(OpenApiCompare.java:99)
	at com.qdesrame.openapi.diff.OpenApiCompare.fromLocations(OpenApiCompare.java:88)
	at com.qdesrame.openapi.diff.OpenApiCompare.fromLocations(OpenApiCompare.java:76)

This PR fix it an add a test.

@quen2404
Copy link
Member

quen2404 commented Jun 7, 2018

Thank you for this pull request ! 👍

@quen2404 quen2404 merged commit 4ebff86 into OpenAPITools:master Jun 7, 2018
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