Basically, I'm trying to limit the values that can be provided by a WFS transaction. So the original schema I've got for this simple test feature here
<xsd:complexType name="secondfeatureType">
<xsd:complexContent>
<xsd:extension base="gml:AbstractFeatureType">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="objectid" nillable="false" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="0" name="color" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="shape" nillable="true" type="gml:GeometryPropertyType"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="secondfeature" substitutionGroup="gml:_Feature" type="geofeatures:secondfeatureType"/>
But I want to limit the value of color to several options: 'Red', 'Green', 'Blue'
I tried creating the following schema for Geoserver to use for this feature:
<xsd:simpleType name="colorType" final="restriction">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Red"/>
<xsd:enumeration value="Green"/>
<xsd:enumeration value="Blue"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="secondfeatureType">
<xsd:complexContent>
<xsd:extension base="gml:AbstractFeatureType">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="objectid" nillable="false" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="0" name="color" nillable="true" type="colorType"/>
<xsd:element maxOccurs="1" minOccurs="0" name="shape" nillable="true" type="gml:GeometryPropertyType"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="secondfeature" substitutionGroup="gml:_Feature" type="geofeatures:secondfeatureType"/>
But the result is that any Insert Transaction I attempt to perform for this feature, the color value ends up being an empty string. It's the same result whether I try and create a feature with a color of "red" or deliberately bad value like "badvalue".
Is something like this even possible with GeoServer and WFS? If so, what do I need to change to make this work?