Skip to content

Conversation

@mdaneri
Copy link
Contributor

@mdaneri mdaneri commented Jan 22, 2026

Pull Request

Description

Reject RFC 6570 URI template operators (e.g. {+path}, {path*}, {?q}) in path keys when serializing OpenAPI <= 3.1. These operators are only valid starting in OpenAPI 3.2.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe):

Related Issue(s)

Fixes #2704

Changes Made

  • Throw OpenApiException if an OpenApiPaths key contains RFC 6570 operators when targeting OpenAPI 2.0/3.0/3.1.
  • Add unit tests for operator paths ({+var}, {var*}) and a non-operator control case.

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • All existing tests pass

Ran:

  • dotnet test test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj --filter FullyQualifiedName~Microsoft.OpenApi.Tests.Models.OpenApiPathsTests

Checklist

  • My code follows the code style of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Versions applicability

  • My change applies to the version 1.X of the library, if so PR link:
  • My change applies to the version 2.X of the library, if so PR link:
  • My change applies to the version 3.X of the library, if so PR link:
  • I have evaluated the applicability of my change against the other versions above.

Additional Notes

None.

@mdaneri mdaneri requested a review from a team as a code owner January 22, 2026 16:40
Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

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

See my comments here #2704 (comment)

@baywet baywet closed this Jan 22, 2026
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.

Incorrect generation of RFC 6570 {+param} in OpenAPI versions ≤ 3.1

2 participants