Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix use="required" for attributes in inner classes. #820

Merged
merged 4 commits into from
Jul 16, 2023

Conversation

skinkie
Copy link
Contributor

@skinkie skinkie commented Jul 14, 2023

📒 Description

When an element has a restriction, it may override an attribute's use-attribute, for example from optional to required. This patch reflects this change.

Resolves #819

🔗 What I've Done

Write a description of the steps taken to resolve the issue

#819 contains the minimum XSD to check the generation. I basically step by step went though the generation process until I found that RESOLVE causes the attributes of 'test' to disappear.

💬 Comments

First true contribution? ;-)

🛫 Checklist

@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (fcb89c2) 99.96% compared to head (8f7e789) 99.96%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #820   +/-   ##
=======================================
  Coverage   99.96%   99.96%           
=======================================
  Files         104      104           
  Lines        9249     9263   +14     
  Branches     2068     2073    +5     
=======================================
+ Hits         9246     9260   +14     
  Partials        3        3           
Impacted Files Coverage Δ
...data/codegen/handlers/calculate_attribute_paths.py 100.00% <ø> (ø)
.../codegen/handlers/validate_attributes_overrides.py 100.00% <ø> (ø)
xsdata/codegen/handlers/create_compound_fields.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tefra tefra force-pushed the fix_attributes_use_required branch 2 times, most recently from 21f236a to 3c8adce Compare July 16, 2023 09:45
@tefra tefra force-pushed the fix_attributes_use_required branch from 3c8adce to 8f7e789 Compare July 16, 2023 09:56
@tefra
Copy link
Owner

tefra commented Jul 16, 2023

Good first attempt, unfortunately lately a lot of issues have the butterfly effect. Hacks or questionable decisions appear out of nowhere in unrelated areas.

@sonarcloud
Copy link

sonarcloud bot commented Jul 16, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@tefra tefra merged commit 68d5071 into tefra:main Jul 16, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When a schema overrides attributes (with use="required") this is not reflected in the output
2 participants