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

Relax conditions on extensions flattening #754

Merged
merged 7 commits into from
Feb 25, 2023
Merged

Relax conditions on extensions flattening #754

merged 7 commits into from
Feb 25, 2023

Conversation

tefra
Copy link
Owner

@tefra tefra commented Feb 25, 2023

📒 Description

The generator is flattening extensions when the subclass is overriding fields with diffrent types.

This part of the code is from the very first versions of xsdata and has a few major flaws like not walking the whole mro and not allowing overriding object overrides.

Resolves #738

🔗 What I've Done

  • Remove that part of the code. It runs early in the flow and there are handlers down the pipleline that do much better job working with type conflicts.
  • Harden the conditions that indicate field overrides to also include namespace and the actual xml type instead of just the tag name.
  • Update compound field handler to allow overriding compound fields with different types (Same elements!!!)
  • Update the default type for xs:attributes to xs:anySimpleType (to allow overriding safely from type==object)

💬 Comments

🛫 Checklist

@codecov
Copy link

codecov bot commented Feb 25, 2023

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (fa51f61) compared to base (7d93ade).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #754   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          101       101           
  Lines         8828      8839   +11     
  Branches      1955      1958    +3     
=========================================
+ Hits          8828      8839   +11     
Impacted Files Coverage Δ
...sdata/codegen/handlers/flatten_class_extensions.py 100.00% <ø> (ø)
xsdata/codegen/handlers/create_compound_fields.py 100.00% <100.00%> (ø)
...egen/handlers/sanitize_attributes_default_value.py 100.00% <100.00%> (ø)
.../codegen/handlers/validate_attributes_overrides.py 100.00% <100.00%> (ø)
xsdata/codegen/models.py 100.00% <100.00%> (ø)
xsdata/models/xsd.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

@sonarqubecloud
Copy link

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 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@tefra tefra merged commit 4b4091c into master Feb 25, 2023
@tefra tefra deleted the fix-738 branch February 25, 2023 10:25
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.

restriction base not used in generation
1 participant