vscode-extension icon indicating copy to clipboard operation
vscode-extension copied to clipboard

Policy Settings syntax failing schema validation

Open arpan3t opened this issue 1 year ago • 0 comments
trafficstars

Not sure how much of an impact on the schema this group has, but when using a policy setting e.g., TenantId="{Settings:Tenant}" while having the XML file associated with the schema:

"xml.fileAssociations": [
    {
        "pattern": "**.xml",
        "systemId": "https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-custom-policy-starterpack/master/TrustFrameworkPolicy_0.3.0.0.xsd"
    }
]

as recommended in Troubleshoot policy validation causes the validator to throw errors for cvc-pattern-valid and cvc-attribute. I think both errors are due to characters {:} not passing the regular expression pattern set in the schema:

  <xs:simpleType name="TenantId">
    <xs:annotation>
      <xs:documentation>
        Represents a tenant id.
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:pattern value="[A-Za-z0-9\.]{3,63}" />
    </xs:restriction>
  </xs:simpleType>

As a workaround I've had to exclude the directory that I develop in from validation using:

"xml.validation.filters": [
    {
        "pattern": "CustomPolicies\\*.xml",
        "enabled": false,
        "schema": {
            "enabled": "never"
        }
    }
]

Consider hosting modified version of the schema, thanks.

arpan3t avatar Sep 10 '24 22:09 arpan3t