Skip to content

Commit

Permalink
feat(*): removes superflous tags, declares element
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Casey <[email protected]>
  • Loading branch information
jonathan-casey committed Nov 9, 2023
1 parent 5e2dcc5 commit 3412f86
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/codegen/fromcto/xmlschema/xmlschemavisitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,14 @@ class XmlSchemaVisitor {

parameters.fileWriter.writeLine(0, `<xs:complexType name="${mapDeclaration.getName()}">` );
parameters.fileWriter.writeLine(1, '<xs:sequence>');
parameters.fileWriter.writeLine(2, '<xs:complexType>');
parameters.fileWriter.writeLine(3, '<xs:sequence>');
parameters.fileWriter.writeLine(4, `<xs:element name="key" type="${key}"/>`);
parameters.fileWriter.writeLine(4, `<xs:element name="value" type="${value}"/>`);
parameters.fileWriter.writeLine(3, '</xs:sequence>');
parameters.fileWriter.writeLine(2, '</xs:complexType>');
parameters.fileWriter.writeLine(2, `<xs:element name="key" type="${key}"/>`);
parameters.fileWriter.writeLine(2, `<xs:element name="value" type="${value}"/>`);
parameters.fileWriter.writeLine(1, '</xs:sequence>');
parameters.fileWriter.writeLine(0, '</xs:complexType>');

// declare the element
const { name: namespace } = ModelUtil.parseNamespace(mapDeclaration.getNamespace());
parameters.fileWriter.writeLine(0, `<xs:element name="${mapDeclaration.getName()}" type="${namespace}:${mapDeclaration.getName()}"/>` );
return null;
}

Expand Down

0 comments on commit 3412f86

Please sign in to comment.