Support of xs:list
I am not sure, if this is a bug.
I have created a package for the HitchHikerAPI at https://github.com/Fincallorca/HitchHikerApi (you need an account / credentials to use the API).
The WSDL contains an element GDSTypes allowing multiple values.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" [...]
<xs:element xmlns:q11="HitchHiker.FlightAPI.enums" name="GDSTypes" type="q11:GDSTypeEnum"/>
The related enum type allows multiple values
<xs:simpleType name="GDSTypeEnum">
<xs:list>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="None">
<xs:annotation>
<xs:appinfo>
<EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">0</EnumerationValue>
</xs:appinfo>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="Published">
<xs:annotation>
<xs:appinfo>
<EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">1</EnumerationValue>
</xs:appinfo>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="Negotiated">
<xs:annotation>
<xs:appinfo>
<EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">2</EnumerationValue>
</xs:appinfo>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:list>
</xs:simpleType>
The <xs:list> element allows multiple values inside GDSTypes. Something like Published Negotiated should be possible, the the auto generated php classes allows only a single value instead of multiple. You can check the code here: https://github.com/Fincallorca/HitchHikerApi/blob/fc2c1202872f4230613332cae4a58564953b361d/src/Wsdl/v3_1_388_1/StructType/GDSFares.php#L28
public function setGDSTypes($gDSTypes = null)
{
// validation for constraint: enumeration
if (!\Fincallorca\HitchHikerApi\Wsdl\v3_1_388_1\EnumType\GDSTypeEnum::valueIsValid($gDSTypes)) {
throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $gDSTypes, implode(', ', \Fincallorca\HitchHikerApi\Wsdl\v3_1_388_1\EnumType\GDSTypeEnum::getValidValues())), __LINE__);
}
$this->GDSTypes = $gDSTypes;
return $this;
}
Does the package support the xs:list?
The list tag is currently handled so it might be an issue.
In my point of view, it should be the Fincallorca\HitchHikerApi\Wsdl\v3_1_388_1\StructType\GDSFares::GDSTypes attribute that should be marked as an array, with the attribute maxOccurs="unbounded", in the WSDL so it would then generate the setter properly.
Is there anyway you could send me the WSDL at [email protected]?
As pointed out privately and rightly by @prokki:
- list datatype is a set of literals whose internal structure is a space-separated sequence of literals of the atomic datatype of the items in the list.
To be fixed...
Hi @prokki If possible, could you try generating your PHP SDK using the feature/158 branch?
Let me know how it goes then, Thx