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

fix: updating the ResponseSchemaBody for the async flattenSchema changes #999

Merged
merged 3 commits into from
Oct 21, 2020

Conversation

erunion
Copy link
Member

@erunion erunion commented Oct 20, 2020

🧰 What's being changed?

With readmeio/oas#292, oas/tooling/lib/flattenSchema is now an async library to enable us to properly handle circular $ref pointers when flattening a response in the ResponseSchemaBody component.

This change updates the ResponseSchemaBody component to be compatible with the changes incoming in readmeio/oas#292.

🧪 Testing

Here's an example of a circular ref'd schema that's currently failing when we're flattening the response schema: http://bin.readme.com/s/5f8f6eec31f4240024e73488

@erunion erunion added type:bug Something isn't working type:refactor Issues about tackling technical debt labels Oct 20, 2020
@erunion erunion requested a review from darrenyong October 21, 2020 17:27
Copy link
Member

@gratcliff gratcliff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall! Just one question below:

const { flattenedSchema } = this.state;

let rows = [];
if (flattenedSchema) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure this'll always be iterable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah flattenedArray on line 39 where this state prop is set will always return an array.

Copy link
Contributor

@darrenyong darrenyong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with the spec and renders without an error!

@erunion erunion merged commit a77cff9 into next Oct 21, 2020
@erunion erunion deleted the fix/response-body-circular-refs branch October 21, 2020 20:29
erunion added a commit that referenced this pull request Oct 21, 2020
…ges (#999)

* fix: updating the ResponseSchemaBody for the async flattenSchema changes

* chore(deps): upgrading oas to 4.1.0

* chore(deps): bumping oas to 5.0.0
erunion added a commit that referenced this pull request Oct 21, 2020
* chore: wip integrating ui into explorer

* feat(tutorials): preliminary integration work for tutorials in explorer
- @readme/ui v1.10.0 (webpack)
- General tutorial structure
- TODO: context consumption from ui

* fix: lint issues

* chore: fixing latent conflict

* feat(tutorials): ui lib upgrade
- Bringing in babel fix for classname references
- Adding variable provider

* style(tutorials): add container styling

* chore: forcing ci to hoist deps

* chore: removing dev-focused tutorials

* chore: re-running npm install to fix dep issues

* ci: hoisting deps up on installation

* fix: pinning the oas dep to 4.0.0 as 4.1.0 was a breaking change

* feat: adding an experiment to the demo app for tutorials

* fix(tutorials): responding to review comments
- Fixing tutorial object for demo consumption
- Checking doc.tutorials.length prior to implementing styled div

* feat: set default javascript target to use fetch instead of xhr (#1000)

In the same vain as 4bf7464

* fix: updating the ResponseSchemaBody for the async flattenSchema changes (#999)

* fix: updating the ResponseSchemaBody for the async flattenSchema changes

* chore(deps): upgrading oas to 4.1.0

* chore(deps): bumping oas to 5.0.0

* chore: re-running hoisting

* fix: disabling tutorials by default until it's fully launched

Co-authored-by: Tony Li <runnabro@users.noreply.github.com>
Co-authored-by: Jon Ursenbach <jon@ursenba.ch>
Co-authored-by: domharrington <domharrington@users.noreply.github.com>
Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type:bug Something isn't working type:refactor Issues about tackling technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants