Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Wrong names for arrays properties in autogenerated XSDs #540

Closed
dfmacias opened this issue Aug 17, 2018 · 0 comments
Closed

Wrong names for arrays properties in autogenerated XSDs #540

dfmacias opened this issue Aug 17, 2018 · 0 comments
Assignees
Labels
Milestone

Comments

@dfmacias
Copy link
Contributor

Given the following raml:

#%RAML 1.0
title: simple object
types:
  root:
    properties:
      name: string
      friends: Friend[]
    additionalProperties: false
  Friend:
    type: object
    xml:
      name: Friend
    properties:
      name: string
    additionalProperties: true

Raml parser is generating the following schema for types

<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://validationnamespace.raml.org" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://validationnamespace.raml.org">
    <element name="root" type="tns:root"/>
    <complexType name="root">
        <sequence>
            <element name="name">
                <simpleType>
                    <restriction base="string"/>
                </simpleType>
            </element>
            <element maxOccurs="unbounded" name="Friend" type="tns:Friend"/>
        </sequence>
    </complexType>
    <complexType name="Friend">
        <sequence>
            <element name="name">
                <simpleType>
                    <restriction base="string"/>
                </simpleType>
            </element>
            <any maxOccurs="unbounded" minOccurs="0" processContents="skip"/>
        </sequence>
    </complexType>
</schema>

When the following schema is expected:

<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://validationnamespace.raml.org" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://validationnamespace.raml.org">
    <element name="root" type="tns:root"/>
    <complexType name="root">
        <sequence>
            <element name="name">
                <simpleType>
                    <restriction base="string"/>
                </simpleType>
            </element>
            <element maxOccurs="unbounded" name="friends" type="tns:Friend"/>
        </sequence>
    </complexType>
    <complexType name="Friend">
        <sequence>
            <element name="name">
                <simpleType>
                    <restriction base="string"/>
                </simpleType>
            </element>
            <any maxOccurs="unbounded" minOccurs="0" processContents="skip"/>
        </sequence>
    </complexType>
</schema>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant