Conversation
|
To make it easier to understand could you translate this to English and explain why do you need this change? Also, if it is possible please cover changes with the tests. |
|
From deepl: """ Tentatively solved the problem that xmlToObject for ltea does not convert array types as arrays. Not sure if that helps 🤷 but I was curious :) |
| type = splitQName(type); | ||
| const typeStorage = this.$type ? definitions.descriptions.types : definitions.descriptions.elements; | ||
| const typeName: string = type.name; | ||
| if(typeName in typeStorage){// typeにtypeNameが入ってしまった場合の対応、本来はこのようなことが起きないように対処すべきかもしれない。 |
There was a problem hiding this comment.
"// typeName in type, perhaps this should be handled to prevent this from happening in the first place."
| const typeName: string = type.name; | ||
| if(typeName in typeStorage){// typeにtypeNameが入ってしまった場合の対応、本来はこのようなことが起きないように対処すべきかもしれない。 | ||
| if (this.$ref) { | ||
| element = typeStorage[typeName]; |
There was a problem hiding this comment.
Probably, need to check that typeStorage[typeName] has a value, could be undefined, null ... anything
w666
left a comment
There was a problem hiding this comment.
Needs a test. While code makes sense, implementation should be locked, so other changes do not break this,
|
Upon reading further, unless I don't understand something, I believe actually the existing code already covers what the PR proposes just further down a few lines. Specifically the check's if() and the else() and the value is set properly. node-soap/src/wsdl/elements.ts Line 261 in 9c6ad01 node-soap/src/wsdl/elements.ts Line 292 in 9c6ad01 If my understanding is correct, I think this PR can simply be closed. |
|
@w666 -- per my earlier reasoning the current code I think covers what was proposed here due to another PR that got merged and covers element values in different configurations; I think it was min/maxOccurs PR that refactored that code. Please review if you agree with me and simply close this PR if you do. I don't think there is much else to do here. |
alteaに対するxmlToObjectで配列型を配列として変換してくれない問題を暫定的に解消。
node-soap的に望ましい実装ではなさそうだが...。