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

Do not create intermediary types for array elements #107

Merged
merged 4 commits into from
Mar 11, 2019
Merged

Do not create intermediary types for array elements #107

merged 4 commits into from
Mar 11, 2019

Conversation

RedX2501
Copy link
Contributor

@RedX2501 RedX2501 commented Mar 8, 2019

The generator will create intermediary types even when the element is only an array:

element book
  complextype
    sequence
      element contents
        complextype
          element content type content maxBound unbounded
    sequence
  complextype

would generate

class book {
    container <content> contents;
}

class bookContent {
    container<content> contents;
}

class content  {
}

With this patch an option GenerateComplexTypesForCollections is introduce. By default it is false and would produce the following code:

class book {
    container <content> contents;
}

class content  {
}

@codecov
Copy link

codecov bot commented Mar 8, 2019

Codecov Report

Merging #107 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #107      +/-   ##
==========================================
+ Coverage   97.13%   97.14%   +<.01%     
==========================================
  Files          17       17              
  Lines        2964     2974      +10     
==========================================
+ Hits         2879     2889      +10     
  Misses         85       85
Impacted Files Coverage Δ
XmlSchemaClassGenerator/TypeModel.cs 96.93% <ø> (ø) ⬆️
XmlSchemaClassGenerator/GeneratorConfiguration.cs 95.31% <100%> (+0.07%) ⬆️
XmlSchemaClassGenerator/Generator.cs 76.08% <100%> (+0.53%) ⬆️
XmlSchemaClassGenerator/FileOutputWriter.cs 100% <100%> (ø) ⬆️
XmlSchemaClassGenerator/ModelBuilder.cs 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4bbf481...580705a. Read the comment docs.

@codecov
Copy link

codecov bot commented Mar 8, 2019

Codecov Report

Merging #107 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #107      +/-   ##
==========================================
+ Coverage   97.13%   97.14%   +<.01%     
==========================================
  Files          17       17              
  Lines        2964     2974      +10     
==========================================
+ Hits         2879     2889      +10     
  Misses         85       85
Impacted Files Coverage Δ
XmlSchemaClassGenerator/TypeModel.cs 96.93% <ø> (ø) ⬆️
XmlSchemaClassGenerator/GeneratorConfiguration.cs 95.31% <100%> (+0.07%) ⬆️
XmlSchemaClassGenerator/Generator.cs 76.08% <100%> (+0.53%) ⬆️
XmlSchemaClassGenerator/FileOutputWriter.cs 100% <100%> (ø) ⬆️
XmlSchemaClassGenerator/ModelBuilder.cs 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4bbf481...d158786. Read the comment docs.

@mganss
Copy link
Owner

mganss commented Mar 8, 2019

👍 This should fix #32. Can you add a test case (perhaps using the xsd linked from #32)?

mganss and others added 2 commits March 11, 2019 09:50
Co-Authored-By: RedX2501 <guibufolo+git@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants