rewiringamerica / api.rewiringamerica.org

A RESTful web API for federal, state, utility and local rebates, tax credits and other electrification incentives.
https://api.rewiringamerica.org
Apache License 2.0
7 stars 0 forks source link

update incentive_relationship_schema #532

Closed matelau closed 1 month ago

matelau commented 1 month ago

To make exporting the incentive relationship easier I have added the explicit type of prereq incentive relationship to each property in the prerequisite object. Transforming

  "prerequisites": {
    "CO-541": "CO-455",
    "CO-542": "CO-457"
  }

to

  "prerequisites": {
    "CO-541": {
      "allof": [
        "CO-455"
      ]
    },
    "CO-542": {
      "allof": [
        "CO-457"
      ]
    }
  },

For more examples see: https://github.com/rewiringamerica/api.rewiringamerica.org/pull/531

This change should be backwards compatible with the existing spreadsheet-to-json scripts, but requires relaxing of the incentives relationship schema from oneOf to anyOf.