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

NullPointException when comparing to pretty similar specs #137

Open
pkunze opened this issue Nov 5, 2024 · 3 comments
Open

NullPointException when comparing to pretty similar specs #137

pkunze opened this issue Nov 5, 2024 · 3 comments

Comments

@pkunze
Copy link
Contributor

pkunze commented Nov 5, 2024

We are running into a null reference exception when comparing two pretty similar specs:

Logs

Loading old API from current_release_approved.json
Loading new API from swagger_hot.json
Successfully loaded APIs
Starting the check for breaking API changes
Exception occured
java.lang.NullPointerException: null
	at java.base/java.util.Objects.requireNonNull(Objects.java:208)
	at java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:180)
	at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.TreeMap$KeySpliterator.forEachRemaining(TreeMap.java:3064)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at io.redskap.swagger.brake.core.model.Schema.internalGetTypes(Schema.java:86)
	at io.redskap.swagger.brake.core.model.Schema.getTypes(Schema.java:77)
	at io.redskap.swagger.brake.core.rule.response.ResponseTypeChangedRule.checkRule(ResponseTypeChangedRule.java:39)
	at io.redskap.swagger.brake.core.DefaultBreakecker.lambda$check$1(DefaultBreakChecker.java:31)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at io.redskap.swagger.brake.core.DefaultBreakChecker.check(DefaultBreakChecker.java:31)
	at io.redskap.swagger.brake.runner.Checker.check(Checker.java:32)
	at io.redskap.swagger.brake.runner.Runner.run(Runner.java:52)
	at io.redskap.swagger.brake.runner.Starter.start(Starter.java:15)
	at io.redskap.swagger.brake.cli.Cli.start(Cli.java:34)
	at io.redskap.swagger.brake.cli.SwaggerBrakeMain.main(SwaggerBrakeMain.java:16)
For help please use --help
script returned exit code 2

I can provide the two specs that cause the error via mail. Unfortunately, i cannot share them publicly here.

You don't seem to have sponsoring turned on or a coffe link, but i would gladly tip you one or another beer since we really enjoy your work!

@pkunze pkunze changed the title Null NullPointException when comparing to pretty similar specs Nov 5, 2024
@galovics
Copy link
Member

galovics commented Nov 7, 2024

hi @pkunze,

If it's possible, you can share them with me via email as well (arnold_galovics(at)docktape(dot).com) and I can strip it down to a point where it could be used for the automated tests in the project.

On the coffee, thanks for the nice words, I'll look it into. :-)

@pkunze
Copy link
Contributor Author

pkunze commented Nov 22, 2024

I somehow missed your comment. Sorry for my late response. I will send them to you on monday. :)

@pkunze
Copy link
Contributor Author

pkunze commented Nov 26, 2024

I just sent them as discussed above. :) Sorry for the delay!

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

No branches or pull requests

2 participants