Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show a warning in the IDE using the XSD when using an incorrect forward (for most pipes) #230

Open
thomaspj10 opened this issue Sep 26, 2024 · 0 comments

Comments

@thomaspj10
Copy link
Contributor

This is a continuation of:
#7274

I've created a very simple proof of concept:

CustomFrankConfig.xsd:

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:element name="Forward">
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="xs:string">
                    <xs:attribute type="xs:string" name="name" use="required" />
                    <xs:attribute type="xs:string" name="path" use="required" />
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

    <xs:element name="FixedResultPipe">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="Forward" minOccurs="0" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:simpleContent>
                            <xs:extension base="xs:string">
                                <xs:attribute name="name" use="required">
                                    <xs:simpleType>
                                        <xs:restriction base="xs:string">
                                            <xs:enumeration value="success" />
                                            <xs:enumeration value="error" />
                                        </xs:restriction>
                                    </xs:simpleType>
                                </xs:attribute>
                                <xs:attribute type="xs:string" name="path" use="required" />
                            </xs:extension>
                        </xs:simpleContent>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
            <xs:attribute type="xs:string" name="name" use="required" />
        </xs:complexType>
    </xs:element>

    <xs:element name="EchoPipe">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="Forward" minOccurs="0" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:simpleContent>
                            <xs:extension base="xs:string">
                                <xs:attribute name="name" use="required">
                                    <xs:simpleType>
                                        <xs:restriction base="xs:string">
                                            <xs:enumeration value="success" />
                                            <xs:enumeration value="echo" />
                                            <xs:enumeration value="exit" />
                                        </xs:restriction>
                                    </xs:simpleType>
                                </xs:attribute>
                                <xs:attribute type="xs:string" name="path" use="required" />
                            </xs:extension>
                        </xs:simpleContent>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
            <xs:attribute type="xs:string" name="name" use="required" />
        </xs:complexType>
    </xs:element>

    <xs:element name="UnrestrictedForwardPipe">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="Forward" minOccurs="0" maxOccurs="unbounded" />
            </xs:sequence>
            <xs:attribute type="xs:string" name="name" use="required" />
        </xs:complexType>
    </xs:element>

    <xs:element name="Configuration">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="FixedResultPipe" minOccurs="0" maxOccurs="unbounded" />
                <xs:element ref="EchoPipe" minOccurs="0" maxOccurs="unbounded" />
                <xs:element ref="UnrestrictedForwardPipe" minOccurs="0" maxOccurs="unbounded" />
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

configuration.xml:

<Configuration
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="CustomFrankConfig.xsd"
>
    <FixedResultPipe name="returnResult">
        <Forward name="error" path="ServerError"></Forward>
    </FixedResultPipe>
    <EchoPipe name="doEcho">
        <Forward name="echo" path="Exit404"></Forward>
    </EchoPipe>

    <UnrestrictedForwardPipe name="unrestricted!">
        <Forward name="aaaaa" path=""></Forward>
    </UnrestrictedForwardPipe>
</Configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant