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

[V2] SimpleType not handled well under latest metadata WSDL #1330

Open
Yoshihisa-Matsumoto opened this issue May 16, 2023 · 1 comment
Open

Comments

@Yoshihisa-Matsumoto
Copy link

When I execute wsdl2schema.ts (2.0/src/api/wsdl/wsdl2schema.ts) and imported latest metadata WSDL ver58,
it didn't handle simpleType restriction very well.

I checked the program, and found extractComplexTypes function was root cause.

From: (Line#180)
const rs = simpleType.restriction ?? simpleType['xsd:restriction'];

To:
let rs = simpleType.restriction;
if (rs.$.base.length == 0 || !rs.$.base.includes(':'))
rs = simpleType['xsd:restriction'];

simpleType.restriction is not empty and simpleType.restrinction.base has empty string
So original code returned base type as undefined , which caused tons of typescript error on generated file.

@Yoshihisa-Matsumoto
Copy link
Author

detail :
some simpleType JSON would be as follows.
as you see, restriction.$.base is empty string, so original code always set 'undefined'

{
'$': { name: 'ID' },
'xsd:restriction': {
'$': { base: 'xsd:string' },
'xsd:length': [Object: null prototype] { '$': [Object: null prototype] },
'xsd:pattern': [Object: null prototype] { '$': [Object: null prototype] },
enumeration: [],
'xsd:enumeration': []
},
restriction: { '$': { base: '' }, enumeration: [], 'xsd:enumeration': [] }
}

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