Closed FizzGirl closed 6 years ago
good catch, and thanks for the detailed explanation. I'm not very comfortable with this part of the code as this is a community contribution, but I'll try to add a test. And BTW, the ìtems`field is using a raw type instead of a generic, and when I add generic types, the compiler immediately raises an error. I'll try to add all missing generics...
fixed in 1.2.4
Works like a charm now, thanks for your reactivity :+1:
Hi,
thanks for your work on this plugin, comes in really handy :-)
I'm experiencing however the following issue when validating one of my Swaggers:
Due to company restrictions I cannot post my Swagger JSON file here, but I did some digging in the code and saw the following which seems like a minor bug: https://github.com/sylvainlaurent/swagger-validator-maven-plugin/blob/e318f435e2c093392f7cc0f22b7e634249ea754a/src/main/java/com/github/sylvainlaurent/maven/swaggervalidator/semantic/node/model/ArrayModelWrapper.java#L18-L22
The CCE occurs on the
items.accept(this)
line .items
being of typeVisitableProperty
which implements the generic interfaceVisitableObject<T>
with a specific generic typeModelVisitor
:public interface VisitableProperty<T extends Property> extends VisitableObject<ModelVisitor>, PathObject {
Therefore the methodaccept (T visitor)
through the interfaceVisitableProperty
may only receive aModelVisitor
as input. In the above code, as we are passing inthis
which is aArrayModelWrapper
and is not of typeModelVisitor
this causes the CCE behaviour.I noticed that not any of the tests pass through this code yet, but when adding my swagger to the test set, it goes into this code and makes my 'happy flow' test fail. My swagger is OK according to Swagger UI.
Proposed change is thus replacing
items.accept(this)
byitems.accept(modelvisitor)
.