Forums/Community/Feature Requests

PlannedDoneNot planned

Update nil support in REST API responses to support the W3C Schema specification

Rory Primrose
suggested this on Jan 25 12:59 am

The XML responses in the Chargify REST API contain nil="true" attributes to identify null values. This does not conform to the W3C Schema specification for this usage. It should be assigned to the http://www.w3.org/2001/XMLSchema-instance namespace. Without this namespace, the xml serializers in the Microsoft stack are not able to correctly parse the null values as they adhere to the specification.

The xml would like something like the following with this change in place:

<?xml version="1.0" encoding="UTF-8"?>
<products xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="array">
  <product>
    <archived_at type="datetime" xsi:nil="true"></archived_at>
    <product_family>
      <accounting_code xsi:nil="true"></accounting_code>
    </product_family>
  </product>
</products>

Any possibility of fixing the REST responses to use the namespace correctly?

This change might even be backwards compatible if both nil="true" and xsi:nil="true" were added to the XML (testing obviously would be needed). If this is not backwards compatible I assume that Chargify already have a web service versioning strategy in place to handle this.

 

Comments

User photo
Rory Primrose

Forgot to add a link to the spec. It's #2.9 at http://www.w3.org/TR/xmlschema-0/#ref21

January 25, 2012 07:37 am