raml-java-parser icon indicating copy to clipboard operation
raml-java-parser copied to clipboard

Cannot resolve XSD element type with include tags

Open npayneau opened this issue 9 years ago • 0 comments

Hello,

Affects: 1.0.0

Issue

Validations cannot be performed, returning the error: Error validating Schema. Error: src-resolve: Cannot resolve the name 'tns:Personnage' to 'type definition' component.

How to reproduce

person.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" >
    <xs:complexType name="Person">
        <xs:attribute name="firstname" type="xs:string"></xs:attribute>
        <xs:attribute name="lastname" type="xs:string"></xs:attribute>
    </xs:complexType>
</xs:schema>

personList.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:tns="http://www.example.org/small" targetNamespace="http://www.example.org/small">
    <xs:include schemaLocation="./Person.xsd"></xs:include>

    <xs:complexType name="PersonList">
        <xs:sequence>
            <xs:element name="element" type="tns:Person" maxOccurs="unbounded">
            </xs:element>
        </xs:sequence>
    </xs:complexType>
</xs:schema>

And simplified RAML file for issue

#%RAML 1.0
title: Manage person
types:
  PersonListXsd: !include ../xml/PersonList.xsd

...

What do you think?

Aha! Link: https://mulesoft-roadmap.aha.io/features/APIRAML-108

npayneau avatar Oct 18 '16 14:10 npayneau