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

XSD Cycles not taken in charge by XSD2JSON #23

Open
ghost opened this issue Jun 1, 2015 · 2 comments
Open

XSD Cycles not taken in charge by XSD2JSON #23

ghost opened this issue Jun 1, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 1, 2015

Hello,

I'm working as a Technical Architecte on SOA Governance standards.
My current client designed an Enterprise Data model with XSD files, some of objects are referencing themselves (a company has contacts, and contacts are attached to a company).
Today, I'm working on JSon Technical Design rules, and I wanted to base my assessment on Json Enterprise Data model, but the cycles between XSD are not correctly understood by xsd2json.

I also had some issues when I am not using the option "-u", I'm quite sure that using this option by default could help many people who are trying to resolve the problem by installing Visual Studio or Microsoft Visual Express or SDK or many other frameworks ..... With -u option at the end it is not necessary and more simple.

Could you please provide a patch for these loops?
From my point of view, I analyzed the JSON files generated from an XSD without cycles, and I can see that references on complextypes are writen, as for XSD. So when the Complextype is detected the first time, it must be generated in the JSON file, but the second time, it is not necessary to go ahead on it.
I think that a simple hashtable in memory, reminding the complextype "already processed" in order to NOT analyze them twice could be a good entry point, but as I am not expert on Javascript and Swiple programs, I am not able to propose a solution.

You can contact me on this email: [email protected]

Thxs for your help,
Richard

@fnogatz
Copy link
Owner

fnogatz commented Nov 3, 2015

I've added two tests for recursive XSD, but both produce valid JSON Schema. My assumption is that the loops occur only when the cycles are across multiple XSD files referencing each other. Is this the case for your failing examples? Could you please provide a simple test case?

@ghost
Copy link
Author

ghost commented Nov 3, 2015

After checking, I think that my problem is related to the number of
imports: I have sometimes more than 5 files imported, which have imports
too inside.

Could you please check that xsd2json manages multiple imports correctly?

Thxs,
Richard

2015-11-03 1:25 GMT+01:00 Falco Nogatz [email protected]:

I've added two tests for recursive XSD, but both produce valid JSON
Schema. My assumption is that the loops occur only when the cycles are
across multiple XSD files referencing each other. Is this the case for your
failing examples? Could you please provide a simple test case?


Reply to this email directly or view it on GitHub
#23 (comment).

Richard VILLANUEVA

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

No branches or pull requests

1 participant