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

Duplicate types enhencements #302

Merged
merged 14 commits into from
Jul 15, 2020
Merged

Duplicate types enhencements #302

merged 14 commits into from
Jul 15, 2020

Conversation

veewee
Copy link
Contributor

@veewee veewee commented Jun 12, 2020

Fixes #300

I made something that allows you to manipulate the metadata before types are generated.
To try it out, I also added 2 possible strategies for fixing duplicate types.

  • IntersectDuplicateTypesStrategy (default) -> this merges all duplicate types into 1 big type
  • RemoveDuplicateTypesStrategy

This seems to do the trick.
Currently it matches on exact case match. This might not work if you have similar types in different cases. For example a "file" and a "File" type.

I was thinking about other strategies as well, but there is just no unique identifier like an XSD namespace. This means I could for example add an increment number, but then the code will break once items are moved inside the XSD (which is suboptimal). Another option was to make a hash of the properties, but that would also break if the type changes. Therefore, I think it is imposible to generate separate classes per type with ext-soap.

Unless anyone has any better idea?

TODO:

  • Tests
  • Documentation
  • Improved duplicates detector (case insensitive, special chars, ...)

@veewee veewee changed the title [WIP] Duplicate types enhencements Duplicate types enhencements Jun 23, 2020
docs/drivers/ext-soap.md Outdated Show resolved Hide resolved
docs/drivers/metadata.md Outdated Show resolved Hide resolved
docs/drivers/metadata.md Outdated Show resolved Hide resolved
@drupol
Copy link
Contributor

drupol commented Jun 24, 2020

This is great, massive improvements, can't wait to see this merged :-)

Copy link
Contributor

@drupol drupol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nits

@veewee veewee added this to the 1.3.0 milestone Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error while generating the Types
3 participants