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'm still trying to understand if it's defined this way for a reason: https://github.com/membrane/soa-model/blob/062ddf7c379ca190f9d901b80dc0d48e288556b7/core/src/main/groovy/com/predic8/schema/SimpleType.groovy#L67-L73
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
: https://github.com/er1c/soa-model/commit/099e1292714b6d1f5340375eecd56abc89d785d3I'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