You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But the equals method is ignoring the 'qname' which can cause bad evaluations...Ran into a nasty bug when trying to do a .distinct on the SimpleType collections and getting back different sizes each execution...
import com.predic8.{wsdl => w}
import scala.collection.JavaConverters._
// A good problematic API
val parsed = new w.WSDLParser().parse("http://wss.hpi.co.uk/TradeSoap/services/CoreEnquiryV1?wsdl")
val all = parsed.getSchemas.asScala.toIndexedSeq.map{ _.getAllSchemas.asScala }.head.toIndexedSeq.head.getSimpleTypes.asScala.toIndexedSeq
// Example bad equals
scala> all(0) == all(2)
res79: Boolean = true
scala> all(0)
res80: com.predic8.schema.SimpleType = SimpleType[qname={http://webservices.hpi.co.uk/CoreEnquiryV1}CustomerCodeType,restriction=Restriction[base={http://www.w3.org/2001/XMLSchema}string,facets=[com.predic8.schema.restriction.facet.MinLengthFacet@771c60a6]]]
scala> all(2)
res81: com.predic8.schema.SimpleType = SimpleType[qname={http://webservices.hpi.co.uk/CoreEnquiryV1}PasswordType,restriction=Restriction[base={http://www.w3.org/2001/XMLSchema}string,facets=[com.predic8.schema.restriction.facet.MinLengthFacet@5a9a021b]]]
I have a branch here to add (all?) of the other inherited members to the equals: er1c@099e129
I'm still trying to understand if it's defined this way for a reason:
soa-model/core/src/main/groovy/com/predic8/schema/SimpleType.groovy
Lines 67 to 73 in 062ddf7
But the equals method is ignoring the 'qname' which can cause bad evaluations...Ran into a nasty bug when trying to do a
.distinct
on the SimpleType collections and getting back different sizes each execution...I have a branch here to add (all?) of the other inherited members to the
equals
: er1c@099e129I'm not really sure if I should be adding all of the attributes or just the
qname
...the ComplexTypeequals
is seems to be pretty light too: https://github.com/membrane/soa-model/blob/master/core/src/main/groovy/com/predic8/schema/ComplexType.groovy#L132-L146 but it'sequals
logic seems significantly divergent from theSimpleType
The text was updated successfully, but these errors were encountered: