Comments (6)
I think like option 1 as it seems this will require the last amount of changes for existing users and reordering could be useful for similar cases in the future. Option 2 doesn't sound too bad either, option 3 seems to be a very narrow solution (but might be worth it if the result code is ok to read).
Disclaimer: Please take these thoughts with a grain of salt. In the end we mostly need tests and maintainable code. I didn't dig too deep into the current code. If you feel that implementing nr 1 or so results in messy code, feel free to go after one of the other options. Also feel free to share "work in progress" code (e.g. by mail or in this ticket). I can't promise any timely feedback but at least I'll try.
from soapfish.
I didn't started it yet, but I think the option 1 is the best. Will try it this week and send some work in progress.
from soapfish.
It is done in my branch: FelixSchwarz/soapfish@master...iurisilvio:xsd_reordering
I don't like the solution yet. It works for my test, but I know some failing corner cases.
from soapfish.
I rewrote my implementation, using the default Python .sort(cmp)
. It looks better now.
I don't know every XSD schema detail, maybe it fails in specific cases (can I have a xsd:extension
and xsd:restriction
in the same complexType
?), but I think it is good enough.
I'm trying it with my really complicated WSDLs to check if it fix my problem.
from soapfish.
Python 3 doesn't have the sort(cmp=)
kwarg, but functools.cmp_to_key
handle the problem nicely.
from soapfish.
I did the PR. It fixed my test and works with my WSDLs.
from soapfish.
Related Issues (20)
- Add template file extensions. HOT 1
- Round trip through wsdl2py and py2wsdl should be consistent.
- Create <wsdl:documentation> and <xs:documentation> from docstrings and vice versa
- Python code generation behaviour when dealing with invalid WSDL HOT 1
- Repetition in xs:pattern broken by string formatting.
- wsdl2py failing HOT 2
- Fix Github parent child relationship with FlightDataServices/Soapfish HOT 5
- wsdl2py should mangle python keywords and reserved symbols HOT 4
- soapfish.xsd.Time is missing HOT 1
- wsdl2py throws AttributeError: 'Part' object has no attribute 'split' error HOT 1
- Multiples schema fail to validate in server mode HOT 1
- Client connection to a SOAP service with authentication
- After Enumeration a comma is missing when generating a client code from a locally saved WSDL file
- AttributeError: 'str' object has no attribute 'Service' HOT 6
- Refactor handling of location rewriting. HOT 3
- wsdl2py with imported xsd fails HOT 4
- Do not import base namespaces HOT 5
- Remote imports are handled as local files HOT 2
- Named XSD Element with unnamed complexType child generates invalid python. HOT 4
- wsdl2py jinja2 template not found HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from soapfish.