Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

"Getting default value for OC not supported" error #45

Closed
dodyg opened this issue Dec 4, 2017 · 2 comments
Closed

"Getting default value for OC not supported" error #45

dodyg opened this issue Dec 4, 2017 · 2 comments

Comments

@dodyg
Copy link

dodyg commented Dec 4, 2017

I am trying to generate these XSDs (http://www.iata.org/whatwedo/airline-distribution/ndc/Pages/schema-download2.aspx)

This command dotnet XmlSchemaClassGenerator.Console.dll edist_commontypes.xsd edist_structures.xsd

generates

Unhandled Exception: System.NotSupportedException: Getting default value for OC not supported.
   at XmlSchemaClassGenerator.TypeModel.GetDefaultValueFor(String defaultString) in C:\projects\xmlschemaclassgenerator\XmlSchemaClassGenerator\TypeModel.cs:line 166
   at XmlSchemaClassGenerator.PropertyModel.AddMembersTo(CodeTypeDeclaration typeDeclaration, Boolean withDataBinding) in C:\projects\xmlschemaclassgenerator\XmlSchemaClassGenerator\TypeModel.cs:line 680
   at XmlSchemaClassGenerator.ClassModel.Generate() in C:\projects\xmlschemaclassgenerator\XmlSchemaClassGenerator\TypeModel.cs:line 349
   at XmlSchemaClassGenerator.NamespaceModel.Generate(String namespaceName, IEnumerable`1 parts) in C:\projects\xmlschemaclassgenerator\XmlSchemaClassGenerator\TypeModel.cs:line 54
   at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
   at XmlSchemaClassGenerator.Generator.Generate(IEnumerable`1 files) in C:\projects\xmlschemaclassgenerator\XmlSchemaClassGenerator\Generator.cs:line 197
   at XmlSchemaClassGenerator.Console.Program.Main(String[] args) in C:\projects\xmlschemaclassgenerator\XmlSchemaClassGenerator.Console\Program.cs:line 134
@mganss mganss closed this as completed in 790a656 Dec 5, 2017
@mganss
Copy link
Owner

mganss commented Dec 5, 2017

Thanks for reporting this. I've implemented support for cases like these in 2.0.82-beta.

@mganss mganss changed the title "Getting default value for OC not supported" erorr "Getting default value for OC not supported" error Dec 6, 2017
@mganss
Copy link
Owner

mganss commented Dec 6, 2017

BTW, here's what xsd.exe generates:

// CODEGEN Warning: DefaultValue attribute on members of type ServiceDefinitionTypeFeeMethod is not supported in this version of the .Net Framework.
// CODEGEN Warning: 'default' attribute supported only for primitive types.  Ignoring default='OC' attribute.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants