Skip to content

Conversation

martincostello
Copy link
Member

@martincostello martincostello commented Aug 4, 2025

Test schema reference validity

Add integration test for invalid OpenAPI schema references.

Description

Add a draft of a way to test whether OpenAPI schema references are invalid which builds on top of #63092.

The test fails as it reveals the two issues described in #63090.

Will separately open a feature request for Microsoft.OpenApi to have this built-in to the validation rulesets. microsoft/OpenAPI.NET#2453 and microsoft/OpenAPI.NET#2459

@github-actions github-actions bot added the needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically label Aug 4, 2025
@martincostello martincostello added feature-openapi area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc and removed needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically labels Aug 4, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Aug 4, 2025
- Validate OpenAPI documents with Microsoft.OpenApi.
- Exclude HTTP QUERY endpoints.
- Fix incorrect parameter casing.

Relates to dotnet#63090.
Add integration test for invalid OpenAPI schema references.

Relates to dotnet#63090.
@martincostello martincostello force-pushed the gh-63090-validate-schema-references branch from 06ffc01 to 502f8c7 Compare August 4, 2025 16:44
Refactor to use `OpenApiVisitorBase` and `OpenApiWalker` to recursively validate the entire OpenAPI document.
- Fix typo.
- Improve reported path.
- Find circular references.
Report circular references as an error, rather than throwing an exception.
@martincostello
Copy link
Member Author

Moved into #63092 now that #63256 fixed the schemas.

@martincostello martincostello deleted the gh-63090-validate-schema-references branch August 15, 2025 07:37
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-rc1 milestone Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc community-contribution Indicates that the PR has been added by a community member feature-openapi

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant