Skip to content

[Feature]: Support for OpenAPI Spec 3.2 #2248

Open

Description

@caochenlei

Feature Description

Add support for parsing and validating OpenAPI Specification 3.2.0. This update addresses the gap in current swagger-parser capabilities where only older OpenAPI versions are supported, preventing users from leveraging the latest specification features and improvements.

Use Case

  1. Modern API Development: Teams adopting OpenAPI 3.2.0 for new API specifications cannot use swagger-parser for validation, documentation generation, or code generation workflows
  2. Migration Projects: Organizations upgrading from older OpenAPI versions (3.0.x, 3.1.x) to 3.2.0 need tooling support to validate their migrated specifications
  3. CI/CD Pipelines: Automated API validation in deployment pipelines fails when encountering OpenAPI 3.2.0 specs, breaking development workflows
  4. Toolchain Integration: Downstream tools that rely on swagger-parser (documentation generators, mock servers, client SDK generators) cannot process 3.2.0 specs

Suggested Solution (optional)

  1. Schema Updates: Update the internal schema definitions to support OpenAPI 3.2.0 structure and validation rules
  2. Version Detection: Enhance version parsing to recognize 3.2.0 in the openapi field
  3. Backward Compatibility: Maintain support for existing OpenAPI versions while adding 3.2.0 capabilities
  4. New Feature Support: Implement support for 3.2.0 specific features such as:
    • Updated JSON Schema dialect (2020-12)
    • New webhook object support
    • Enhanced security scheme features

Alternatives Considered

Additional Context

Checklist

  • I have searched the existing issues to ensure this is not a duplicate.
  • This feature would be useful to more than just my use case.
  • I have provided enough detail for the maintainers to understand the scope of the request.

Activity

  1. baywet commented on Jan 12, 2026

    @baywet

    To add some context here, I implemented 3.2.0 support twice recently:

    While the design choices might be different here, this should give a good overview of the required changes. The only things that's missing in those two PRs is the implementation of dynamic reference resolution.

    I hope this helps :)

  2. beavuck commented on Mar 14, 2026

    @beavuck

    Is this issue alive? I'm surprised it hasn't been acknowledged yet

    EDIT: they are currently "working on OAS 3.2 support in editor", according to their recent community post #2284, and their ability to maintain swagger-parser has been "limited"

  3. ayush-sharaf commented on Jul 6, 2026

    @ayush-sharaf

    Adding a concrete downstream use case + repro to help gauge impact.

    We're using TypeSpec → OpenAPI3 → openapi-generator (typescript-axios) as our API pipeline. We want to adopt the HTTP QUERY method (RFC 10008), which OpenAPI 3.2.0 supports as a first-class path-item operation. We filed a feature request upstream for TypeSpec to emit it (microsoft/typespec#11171), but even once that lands, this repo is the blocking dependency for the whole chain — openapi-generator itself is blocked on this issue (OpenAPITools/openapi-generator#22728).

    Concretely, today:

    Happy to help test against a WIP branch if one exists — the reference implementations linked above (scalar's TS PR, OpenAPI.NET's PR) look like reasonable blueprints per @baywet's comment. Given swagger-core#5181 needs to land first for the PathItem/Operation model changes, is there a preferred order of contribution (core first, then parser) if someone wanted to pick this up?

  4. CommanderGeek commented on Jul 23, 2026

    @CommanderGeek

    Hi, I'd like to help move this forward, starting with the new QUERY HTTP method from OAS 3.2 (the JS tooling shipped 3.2 support back in April, but the Java models/parser are still on 3.1).

    I've had a look at where the gap is. On the swagger-core side, PathItem hard-wires the eight 3.1 methods:

    public enum HttpMethod {
        POST, GET, PUT, PATCH, DELETE, HEAD, OPTIONS, TRACE
    }

    so QUERY needs a new field + accessors, plus updates to readOperations(), readOperationsMap(), operation(HttpMethod, Operation), and equals/hashCode/toString. On the swagger-parser side, OpenAPIDeserializer reads the path-item keys explicitly, so it needs "query" added there plus version detection for 3.2.x.

    I'd propose splitting this per repo rather than one big 3.2 change:

    • swagger-core, PathItem.query, version gating so 3.0/3.1 output stays valid, and the JAX-RS reader mapping (+ tests). Those land together because they are one Maven reactor: the reader calls PathItem.query() and the gating mixin references getQuery(), so neither compiles without the model change.
    • swagger-parser parse/serialize it and accept 3.2.x (+ round-trip tests).

    additionalOperations would be a good separate follow-up.

    A potential implementation of the swagger-core half is at swagger-api/swagger-core#5253, happy to reshape it however you prefer, or to split it further if you would rather review the modules separately.

    Two design questions, so I build the rest the way you want:

    1. Version gating. As far as I can tell @OpenAPI31 is documentation-only and it has no @Retention and nothing reads it, while the actual gating is done by the Jackson mixins (e.g. SchemaMixin @JsonIgnore-ing the 3.1-only fields for the 3.0 mapper). #5253 follows that pattern with a PathItemMixin that hides query from both the 3.0 and 3.1 mappers. Is that the mechanism you want for 3.2 constructs, and would you also like an @OpenAPI32 marker alongside it for consistency with the 3.1 fields?

    That does mean nothing in swagger-core emits query yet, since SpecVersion is V30/V31 today. I have assumed that adding SpecVersion.V32 plus Json32/Yaml32 is a separate and much larger piece of work it would touch the openapi31 boolean threaded through core, jaxrs2, integration and the build plugins but say if you would rather see it as part of this.

    2. additionalOperations. Any preference on how it should eventually be modelled, so I do not design QUERY in a way that conflicts with it later? In particular, whether methods without fixed fields should surface through readOperations() / readOperationsMap() alongside the fixed-field ones.

    Thanks!

  5. ca-stefan-cordes commented on Sep 16, 2026

    @ca-stefan-cordes

    Looks like swagger-parser was "forgotten" in April 26 when announcing 3.2.0 support 🤔 ?
    => https://swagger.io/blog/swagger-launches-support-for-openapi-3-2-0/

  6. khayashi4337 commented on Sep 20, 2026

    @khayashi4337

    Opened #2401, which is a much narrower slice than what's being discussed here: it only
    makes swagger-parser recognize "openapi": "3.2.x" and route it through the existing
    3.1 code path (deserializer, resolver/dereferencer), so a 3.2 document no longer gets
    rejected outright. It does not add support for any 3.2-only construct -- query,
    additionalOperations, $self, in: querystring params, or $dynamicRef -- those
    still show up as "unexpected attribute" validation messages and aren't reproduced in
    the parsed model.

    @CommanderGeek's swagger-core work in swagger-api/swagger-core#5253 (the PathItem.query
    model change) is the piece that actually needs to land first for any of those constructs
    to be representable here at all -- this PR is meant to be a small, independent step that
    doesn't conflict with or duplicate that effort, not an attempt to move ahead of it. Happy
    to rebase/adjust once #5253's design questions are settled and a SpecVersion.V32 exists
    to replace the stopgap version-flag widening this PR uses in the meantime.

    🤖 Generated with Claude Code

  7. ceesvanegmond commented on Oct 7, 2026

    @ceesvanegmond

    Looks like swagger-parser was "forgotten" in April 26 when announcing 3.2.0 support 🤔 ? => https://swagger.io/blog/swagger-launches-support-for-openapi-3-2-0/

    Hmmm... following this issue here. 3.2.0 still isn't supported by this library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions