Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

fix: support for repairing malformed array schemas #560

Merged
merged 2 commits into from
Mar 24, 2020
Merged

Conversation

erunion
Copy link
Member

@erunion erunion commented Mar 24, 2020

🧰 What's being changed?

This updates our @readme/oas-tooling and @readme/react-jsonschema-form dependencies to resolve a couple issues with malformed array schemas:

  • If an array schema did not have an items property, we would fail to render the operation.
  • If an array schema had an items property that evaluated to {}, we would fail to render the operation.

What will happen now is if we encounter one of these malformed schemas where items is missing, we'll repair it and add items: {} so that the array can be utilized as a standard mixed-data input.

See readmeio/oas#138 and readmeio/react-jsonschema-form#11 for the respective fixes in @readme/oas-tooling and @readme/react-jsonschema-form.

🧪 Testing

Check the updates to types.json for the example cases.

🗳 Checklist

💡 If answering yes to any of the following, include additional info, before/after links, screenshots, etc. where appropriate!

  • 🆕 I'm adding something new!
  • 🐛 I'm fixing a bug!
  • 📸 I've made some changes to the UI!

@erunion erunion added type:bug Something isn't working scope:dependency Pull requests that update a dependency file labels Mar 24, 2020
@erunion erunion merged commit 25db47e into master Mar 24, 2020
@erunion erunion deleted the fix/empty-arrays branch March 24, 2020 18:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
scope:dependency Pull requests that update a dependency file type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant