From 74061ef95fb038799189089b5df5169592a83cbe Mon Sep 17 00:00:00 2001 From: tinoue Date: Thu, 11 Jan 2024 18:39:19 +0900 Subject: [PATCH] =?UTF-8?q?typeStorage=E3=82=92=E7=A2=BA=E5=AE=9F=E3=81=AB?= =?UTF-8?q?=E5=8F=82=E7=85=A7=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/wsdl/elements.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/wsdl/elements.ts b/src/wsdl/elements.ts index dbd222678..5d2377da5 100644 --- a/src/wsdl/elements.ts +++ b/src/wsdl/elements.ts @@ -225,13 +225,22 @@ export class ElementElement extends Element { let type: any = this.$type || this.$ref; if (type) { type = splitQName(type); + const typeStorage = this.$type ? definitions.descriptions.types : definitions.descriptions.elements; const typeName: string = type.name; + if(typeName in typeStorage){// typeにtypeNameが入ってしまった場合の対応、本来はこのようなことが起きないように対処すべきかもしれない。 + if (this.$ref) { + element = typeStorage[typeName]; + } + else { + element[name] = typeStorage[typeName]; + } + return element; + } const ns: string = xmlns && xmlns[type.prefix] || ((definitions.xmlns[type.prefix] !== undefined || definitions.xmlns[this.targetNSAlias] !== undefined) && this.schemaXmlns[type.prefix]) || definitions.xmlns[type.prefix]; const schema = definitions.schemas[ns]; const typeElement = schema && (this.$type ? schema.complexTypes[typeName] || schema.types[typeName] : schema.elements[typeName]); - const typeStorage = this.$type ? definitions.descriptions.types : definitions.descriptions.elements; if (ns && definitions.schemas[ns]) { xmlns = definitions.schemas[ns].xmlns;