-
-
Notifications
You must be signed in to change notification settings - Fork 531
Support single operation parameter #1535
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 single operation parameter #1535
Conversation
🦋 Changeset detectedLatest commit: 3473462 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Awesome, thank you! Happy to approve & merge this if you’d be so kind as to add a |
Many people use OpenAPI schemas in production that probably violate some aspect of the technical spec in some way or another. Since we’re converting to static TypeScript types, too, there can often be more opinionated interpretation than most realize. So the general approach of this library is to Support as much of the official spec as possible (only barring technical limitations of TypeScript). Beyond the spec, we’ll generally allow for fixes to common footguns/rough edges so long as it doesn’t deviate from the spec, and isn’t a huge maintenance burden to maintain. Your PR is a great example of this—all the existing tests pass; we just covered an additional usecase without any breaking changes. That’s always a win in my book. |
Thanks @drwpow , fully agreed on the flexible approach. I think I added a |
}`); | ||
}); | ||
|
||
it("handles non-array parameters", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great tests 🎉
Thanks again! Changeset is perfect 🙂 |
Thanks @drwpow for merging this PR! Do you think it could be included in an upcoming |
Hi @drwpow , may I ask if there is a plan to release these PR changes in version |
@tvanier yes thank you for the nudge! I needed the nudge. Normally these get deployed automatically but I had to pause it until |
Released! |
Thanks @drwpow , release |
Changes
First, thanks for
openapi-typescript
!I came across a generation failure when compiling the spec below (Azure OpenAI inference).
It appears some operations are defined with one single parameter object, not as array - see an example here.
I am not 100% sure this is valid OpenAPI, but since
openapi-typescript@7
compiles it successfully, I thought it would be good to fix the problem in6.x
.How to Review
All iteration over operation or path
parameters
should callgetParametersArray
to make sure parameters are iterable.Checklist
docs/
updated (if necessary)pnpm run update:examples
run (only applicable for openapi-typescript)