walmart-api-php icon indicating copy to clipboard operation
walmart-api-php copied to clipboard

customize-schemas.php is not idempotent

Open dpash opened this issue 1 year ago • 3 comments

Running customize-schemas.php multiple times results in further modifications of the schemas.

There's three issues:

  1. Security information is stripped away, as it doesn't take existing data into account.
  2. 'x-expose-headers' is added where as previously it's not included. This seems to be a bug due to it being stripped out when first run.
  3. Additions are added multiple times (which results in invalid json due to duplicate parameters in orders.json)

I have fixes for the first two and I'll create a PR for these. I still need to figure out how to resolve the addition issue.

An alternative approach is to download the original schemas to a different directory and then have the customize-schemas.php write out the schemas to new files.

dpash avatar Feb 19 '24 17:02 dpash