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
{{ message }}
This repository has been archived by the owner on Jun 23, 2024. It is now read-only.
When code is generated from a .xsd with namespaces, those namespaces are included in struct field tags for attribute elements. However, encoding/xml does not properly marshal/unmarshal such fields. Deleting the namespace manually from the struct tag corrects the issue.
The resulting code fails to unmarshal MinLength and MaxLength in the following XML:
<QuestionForm xmlns="http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionForm.xsd">
<Question>
<QuestionIdentifier>nextmove</QuestionIdentifier>
<DisplayName>The Next Move</DisplayName>
<IsRequired>true</IsRequired>
<QuestionContent>
<Text>
What are the coordinates of the best move for player "X" in this game?
</Text>
</QuestionContent>
<AnswerSpecification>
<FreeTextAnswer>
<Constraints>
<Length minLength="2" maxLength="2" />
</Constraints>
<DefaultText>C1</DefaultText>
</FreeTextAnswer>
</AnswerSpecification>
</Question>
</QuestionForm>
The text was updated successfully, but these errors were encountered:
When code is generated from a .xsd with namespaces, those namespaces are included in struct field tags for attribute elements. However, encoding/xml does not properly marshal/unmarshal such fields. Deleting the namespace manually from the struct tag corrects the issue.
Here's the command I ran:
$GOPATH/bin/xsd-makepkg -goinst=false -basepath=github.com/jesand/crowds/amt/gen -uri=http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionForm.xsd
The resulting code fails to unmarshal MinLength and MaxLength in the following XML:
The text was updated successfully, but these errors were encountered: