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
structModel:Codable,Equatable,DynamicNodeEncoding{lettype:StringletdocumentVersion:StringletlastSavedToolsVersion:StringletsystemVersion:StringletminimumToolsVersion:StringletsourceLanguage:StringletuserDefinedModelVersionIdentifier:Stringletentities:[Entity]enumCodingKeys:String,CodingKey{case type
case documentVersion
case lastSavedToolsVersion
case systemVersion
case minimumToolsVersion
case sourceLanguage
case userDefinedModelVersionIdentifier
case entities ="entity"}staticfunc nodeEncoding(for key:CodingKey)->XMLEncoder.NodeEncoding{
switch key {caseModel.CodingKeys.type:return.both
caseModel.CodingKeys.documentVersion:return.both
caseModel.CodingKeys.lastSavedToolsVersion:return.both
caseModel.CodingKeys.systemVersion:return.both
caseModel.CodingKeys.minimumToolsVersion:return.both
caseModel.CodingKeys.sourceLanguage:return.both
caseModel.CodingKeys.userDefinedModelVersionIdentifier:return.both
default:return.element
}}}structEntity:Codable,Equatable,DynamicNodeEncoding{letname:StringletrepresentedClassName:Stringletsyncable:StringletcodeGenerationType:Stringletattributes:[Attribute]enumCodingKeys:String,CodingKey{case name
case representedClassName
case syncable
case codeGenerationType
case attributes ="attribute"}staticfunc nodeEncoding(for key:CodingKey)->XMLEncoder.NodeEncoding{
switch key {caseEntity.CodingKeys.name:return.both
caseEntity.CodingKeys.representedClassName:return.both
caseEntity.CodingKeys.syncable:return.both
caseEntity.CodingKeys.codeGenerationType:return.both
default:return.element
}}}structAttribute:Codable,Equatable,DynamicNodeEncoding{letname:Stringletoptional:StringletattributeType:StringletdefaultValueString:StringletuserScalarValueType:Stringletsyncable:StringenumCodingKeys:String,CodingKey{case name
case optional
case attributeType
case defaultValueString
case userScalarValueType
case syncable
}staticfunc nodeEncoding(for key:CodingKey)->XMLEncoder.NodeEncoding{
switch key {caseAttribute.CodingKeys.name:return.both
caseAttribute.CodingKeys.optional:return.both
caseAttribute.CodingKeys.attributeType:return.both
caseAttribute.CodingKeys.defaultValueString:return.both
caseAttribute.CodingKeys.userScalarValueType:return.both
caseAttribute.CodingKeys.syncable:return.both
default:return.element
}}}
when I ran the decode, I get the error:
Fatal error: Unrecognized top-level element of type: NullBox: file
and it's related to the attributes array in Entity, could you help me please?
The text was updated successfully, but these errors were encountered:
Hi @mackmilan, sorry for the delayed reply. Thank you for submitting the XML snippet and the model files. Unfortunately, I don't think that the supplied XML is exactly the same as the one that reproduced your error. There's neither file element nor file attribute present anywhere in that XML. When I pasted the XML and the model types in my tests, I got a different error caused by one of the attributes being absent. The corresponding property was not optional, so changing it to let userScalarValueType: String? with the optional String? fixed the error for these snippets.
I don't think that this is related to autoclosed tags. Would you be able to attach the complete snippet that causes the issue for you?
@MaxDesiatov, you are absolutely right, is not that xml, in fact, I can't reproduce the error anymore, I've changed the userScalarValueType attribute to optional, it works very well.
Thank you for your time.
I have the following xml:
and the structs:
when I ran the decode, I get the error:
Fatal error: Unrecognized top-level element of type: NullBox: file
and it's related to the attributes array in Entity, could you help me please?
The text was updated successfully, but these errors were encountered: