Skip to content

Open API 3.1.0 support#1768

Merged
WoH merged 8 commits into
lukeautry:masterfrom
jefflembeck:openapi-3dot1
Dec 14, 2025
Merged

Open API 3.1.0 support#1768
WoH merged 8 commits into
lukeautry:masterfrom
jefflembeck:openapi-3dot1

Conversation

@jefflembeck
Copy link
Copy Markdown
Contributor

@jefflembeck jefflembeck commented May 20, 2025

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you written unit tests?
  • Have you written unit tests that cover the negative cases (i.e.: if bad data is submitted, does the library respond properly)?
  • This PR is associated with an existing issue?

Closing issues

This addresses number #794.

Put closes #XXXX (where XXXX is the issue number) in your comment to auto-close the issue that your PR fixes.

Potential Problems With The Approach

There is probably way too much here. I cargo culted a ton of things over from 3.0.0. I also made some changes to how certain types extend others.

Test plan

Broke out tests and fixtures strictly for 3.1. Happy to make changes to that, but wanted something we could start talking out earlier rather than later.

This involved breaking 2 and 3 out a little to better mirror the
differences in the specs
@jefflembeck jefflembeck changed the title Openapi 3dot1 Open API 3.1.0 support May 20, 2025
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Hello there jefflembeck 👋

Thank you and congrats 🎉 for opening your first PR on this project.✨

We will review the following PR soon! 👀

@jefflembeck
Copy link
Copy Markdown
Contributor Author

My real issue I wanted to get to the bottom of was getting variadic tuples in. But the differences in prefixItems and items and what is possible for 3.1.0 vs 3.0.0 made me shoot for the moon a little.

@bioc-druzgami
Copy link
Copy Markdown

Any news?

@WoH
Copy link
Copy Markdown
Collaborator

WoH commented Sep 24, 2025

I started on this, but I am very much beyond my capacity until October unfortunately.
This one's a big improvement, and I need want to make time to fix the CI, dependencies and rebase this one onto a green CI.

import { DEFAULT_REQUEST_MEDIA_TYPE, DEFAULT_RESPONSE_MEDIA_TYPE, getValue } from './../utils/swaggerUtils';
import { SpecGenerator } from './specGenerator';

export class SpecGenerator31 extends SpecGenerator {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

First glance, this is probably better extending SpecGenerator3, have you considered that option?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I did. This was actually something I wanted to talk about a little. This part fully got away from me. Differences between examples was my start.

},
err => {
expect(err.message).to.equal('Unsupported Spec version.');
expect(err.message).to.equal('Unsupported Spec version: -2.');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why -2

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, that's just me outputting the spec version that is wrong. (That's the -2 from above)

I made this change while I was working because it made a few things easier to figure out.

Comment thread packages/cli/src/module/generate-spec.ts Outdated
@philsturgeon
Copy link
Copy Markdown

I've been asked to write an article about tsoa and it's OpenAPI generation so I'd love to be able to rewrite for 3.1. If you have any questions RE OAS 3.1 (I was involved in planning it) I am happy to help out!

@WoH
Copy link
Copy Markdown
Collaborator

WoH commented Dec 12, 2025

I've been asked to write an article about tsoa and it's OpenAPI generation so I'd love to be able to rewrite for 3.1. If you have any questions RE OAS 3.1 (I was involved in planning it) I am happy to help out!

I think it's looking pretty good, I need to clean up the typedefs, then it should be good to go

@jefflembeck
Copy link
Copy Markdown
Contributor Author

@WoH you are a hero for this one, man. Thank you for cleaning this up and making it fit into this codebase better. I appreciate it (and have learned a bit more about how things should fit together here)

@WoH WoH merged commit cb0eb10 into lukeautry:master Dec 14, 2025
9 checks passed
@WoH
Copy link
Copy Markdown
Collaborator

WoH commented Dec 14, 2025

It's out, hope this gets rid of your fork 😓

Sorry for the delay, I hope it makes it easier to maintain for me in the coming releases.

@jefflembeck
Copy link
Copy Markdown
Contributor Author

@WoH absolutely herculean effort on your behalf. Thank you. I massively appreciate it.

That being said, as a person with more than a little open source history, being a sole maintainer is really hard and really draining. Don't be afraid to reach out if you want corral some people into joining you. The weight of it all doesn't have to be so heavy.

@jefflembeck jefflembeck deleted the openapi-3dot1 branch December 14, 2025 20:09
@philsturgeon
Copy link
Copy Markdown

Thank you both for working on this, brilliant stuff! If anyone is interested this is the guide I wrote for Speakeasy talking about the new and improved v7.0.0-alpha0. If I've got anything wrong please lmk as its an open repo and I'd rather we got it right. speakeasy-api/developer-docs#91

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.

4 participants