Shopify / pyoozie

Library for querying and scheduling with Apache Oozie
https://py-oozie.readthedocs.io
MIT License
11 stars 12 forks source link

Fix pluralization of credential tag #22

Closed cfournie closed 7 years ago

cfournie commented 7 years ago

This PR changes how the credential tag is implemented to remove its pluralization because oozie-workflow-0.5.xsd indicates that this tag shouldn't be pluralized:

    <xs:complexType name="CREDENTIAL">
        <xs:sequence  minOccurs="0" maxOccurs="unbounded" >
                 <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
                    <xs:complexType>
                       <xs:sequence>
                            <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
                            <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
                            <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
                       </xs:sequence>
                    </xs:complexType>
                 </xs:element>
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="type" type="xs:string" use="required"/>
    </xs:complexType>
kmtaylor-github commented 7 years ago

I'm confused. The schema (versions 0.3-0.5) shows both a credentials and a credential type, so shouldn't we have both as well?

    <xs:complexType name="WORKFLOW-APP">
        <xs:sequence>
            <xs:element name="parameters" type="workflow:PARAMETERS" minOccurs="0" maxOccurs="1"/>
            <xs:element name="global" type="workflow:GLOBAL" minOccurs="0" maxOccurs="1"/>
            <xs:element name="credentials" type="workflow:CREDENTIALS" minOccurs="0" maxOccurs="1"/>
...
    <xs:complexType name="CREDENTIALS">
        <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element name="credential" type="workflow:CREDENTIAL"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="CREDENTIAL">
        <xs:sequence  minOccurs="0" maxOccurs="unbounded" >
                 <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
                    <xs:complexType>
                       <xs:sequence>
                            <xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
                            <xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
                            <xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
...
cfournie commented 7 years ago

I'm confused. The schema (versions 0.3-0.5) shows both a credentials and a credential type, so shouldn't we have both as well?

I'll put credentials as a tag within the future workflow tag builder. credentials contains a list of credential tags.