Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support response schemas #72

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

ciaran
Copy link
Contributor

@ciaran ciaran commented Feb 9, 2023

This tries to handle schema objects which are wrapped via a ResponseObject holding a MediaTypeObject.

Before:
image

After:
image

@netlify
Copy link

netlify bot commented Feb 9, 2023

👷 Deploy request for destiny-data-explorer pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 9a4c0d3

if (found && "$ref" in found) {
throw new Error("Referenced schema can not be a reference schema itself");
}

return found;
return found as OpenAPIV3.SchemaObject;
Copy link
Owner

Choose a reason for hiding this comment

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

I might find some time to check it out myself, but it would be great if we avoided the type assertion/cast.

I know the openapi types are very.... 'everything is a union of everything', but i would prefer this explicitly threw an exception if something isn't as expected, rather than propagate unexpectedly down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants