feat(v29): Switching to OAS 3.2#3480
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Important
The README code example still uses title and version as top-level Documentation params — these must be wrapped into info to match the new DocumentationParams interface.
Reviewed changes — switches the Documentation generator from OpenAPI 3.1 to 3.2, updating openapi3-ts to ^4.6.0, renaming SchemaObject to SchemaObjectValue, changing the Documentation constructor params (title/version → info: InfoObject, serverUrl → server: string | ServerObject | [...]), adding deprecated support to all security schemes, adding oauth2MetadataUrl and deviceAuthorization flow to OAuth2, enriching tag definitions with summary/parent/kind/externalDocs, updating SSE responses to use itemSchema, switching examples from value to dataValue, and providing migration rules.
- OAS version bump —
openapi3-ts→ ^4.6.0, all imports switch fromoas31tooas32, YAML output declaresopenapi: 3.2.0. Documentationconstructor redesign —titleandversionmerge intoinfo: InfoObject;serverUrlbecomesserveracceptingstring,ServerObject, or arrays thereof.- Security
deprecatedflag —Securitytype gains optionaldeprecated?: boolean, propagated to all seven security scheme depicters. - OAuth 2.0 enhancements — new
oauth2MetadataUrloption, newdeviceAuthorizationgrant flow. - Tag definition enrichment —
depictTagsacceptsTagDetailsobjects withsummary,parent,kind, and spreadexternalDocs. - SSE
itemSchemasupport — responses with content typetext/event-streamuseitemSchemainstead ofschemainMediaTypeObject. - Examples rename —
value→dataValueinExamplesObject, matching OAS 3.2 spec. - Migration rules — ESLint rule transforms
new Documentation({ title, version, serverUrl })→new Documentation({ info: { title, version }, server }). - Lint guard — ESLint import restrictions block
oas30/oas31subpaths and bareSchemaObjectimports fromopenapi3-ts.
ℹ️ Skipped "OpenAPI Documentation" test in example
The example/index.spec.ts test validates the generated YAML against the real running server. It was changed to describe.skip because the format change (value → dataValue, openapi: 3.2.0, etc.) broke the AJV validation used in that test. Consider following up with an update to the validation rather than permanently skipping.
Technical details
# Skipped OpenAPI Documentation test
## Affected sites
- `example/index.spec.ts:274` — `describe.skip("OpenAPI Documentation", ...)`
## Required outcome
- Either update the AJV validation schema to accept OAS 3.2 format changes, or create an issue to track re-enabling this test.
## Open questions for the human
- Is there a timeline for updating the AJV-based YAML validation to OAS 3.2, or should a tracking issue be filed?DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
New commit since last review — c4519709 fixes the README example (wrapping title/version into info) and stabilizes the YAML info: ordering to reduce diff noise.
- README code sample corrected — the
Documentationconstructor call now correctly usesinfo: { version, title }andserverinstead of the old top-level params. - YAML ordering stabilized —
example.documentation.yamlkeepstitlebeforeversionunderinfo:, matching the original ordering.
The previously noted skipped test in example/index.spec.ts remains, but is a pre-existing trade-off that can be addressed in follow-up.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
@pullfrog that skipped test is currently replaced by a dedicated workflow. Please assess the completeness of the OAS 3.2 support in this PR. |
There was a problem hiding this comment.
Reviewed changes — upgrades the Documentation class and all related code from openapi3-ts/oas31 to openapi3-ts/oas32, adding support for OAS 3.2 features while breaking the Documentation constructor API (title + version → info: InfoObject, serverUrl → server: string | ServerObject).
- OAS 3.2 type migration — all
SchemaObjectreferences replaced withSchemaObjectValue; imports switched fromoas31tooas32;openapi3-tsbumped to^4.6.0. - SSE
itemSchemasupport — responses with SSEcontent-typenow useitemSchemainstead ofschemainMediaTypeObject, matching the OAS 3.2 spec. - Example format —
ExampleObject.valuereplaced withExampleObject.dataValuethroughout generated specs. - Security scheme
deprecated— all security scheme types (basic,bearer,header,cookie,openid,oauth2,input) now propagate thedeprecatedflag to the generatedSecuritySchemeObject. - OAuth2 device authorization — new
deviceAuthorizationflow andoauth2MetadataUrlproperty onOAuth2Security. - Enhanced tag objects —
depictTagsnow acceptsTagObjectproperties (summary,parent,kind,externalDocs) viaTagDetails. - Breaking
DocumentationAPI —serverUrlrenamed toserver(also acceptsServerObject);titleandversionmerged intoinfo: InfoObject. - Infrastructure — ESLint rules block stale oas30/oas31 imports; migration rules auto-fix constructor calls; dedicated OAS validation workflow added; skipped e2e test properly replaced.
✅ No new issues found.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

squashed from #3437
required for #3479