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

Avoid XmlElementAttribute creation for Properties created via a ref="" #304

Merged
merged 2 commits into from
Feb 2, 2022

Conversation

fabsenet
Copy link
Contributor

@fabsenet fabsenet commented Feb 2, 2022

potentially a fix for #303

This is only a failing unit test for now

@fabsenet fabsenet changed the title (WIP) Avoid XmlElementAttribute creation for Properties created via a ref="" Avoid XmlElementAttribute creation for Properties created via a ref="" Feb 2, 2022
@fabsenet
Copy link
Contributor Author

fabsenet commented Feb 2, 2022

I fixed this now!

There was already the correct code in place for this issue for attributes:

if (attribute.Form == XmlSchemaForm.None)
{
if (attribute.RefName != null && !attribute.RefName.IsEmpty)
property.Form = XmlSchemaForm.Qualified;
else
property.Form = attribute.GetSchema().AttributeFormDefault;
}
else
property.Form = attribute.Form;

which I took for elements as well!

@codecov
Copy link

codecov bot commented Feb 2, 2022

Codecov Report

Merging #304 (c52f248) into master (b351a92) will decrease coverage by 0.02%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #304      +/-   ##
==========================================
- Coverage   95.67%   95.65%   -0.03%     
==========================================
  Files          19       19              
  Lines        3310     3316       +6     
  Branches      484      486       +2     
==========================================
+ Hits         3167     3172       +5     
  Misses         82       82              
- Partials       61       62       +1     
Impacted Files Coverage Δ
XmlSchemaClassGenerator/ModelBuilder.cs 97.41% <85.71%> (-0.10%) ⬇️

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 b351a92...c52f248. Read the comment docs.

@mganss mganss merged commit 5cb6f30 into mganss:master Feb 2, 2022
@mganss
Copy link
Owner

mganss commented Feb 2, 2022

Thanks!

# 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.

3 participants