Is there an existing issue for this?
Describe the bug
To validate the changes made in #63052 I put the OpenAPI schema into editor.swagger.io to see if the schema for JSON Patch had any validation errors (it does not).
However, amongst a few schema errors that are found in the document that aren't just artifacts of testing, I found two that appear to be actual issues:
Semantic error at components.schemas.Category.properties.tags.$ref - $refs must reference a valid location in the document from
|
"$ref": "#/components/schemas/Category/properties/parent/properties/tags" |
Semantic error at components.schemas.Item.properties.name.$ref - $refs must reference a valid location in the document from
|
"$ref": "#/components/schemas/Root/properties/item1/properties/name" |
These correlate to these parts of the code:
|
public IEnumerable<Tag> Tags { get; set; } = []; |
|
public string[] Name { get; set; } = null!; |
Both of these properties are arrays and appear to generate a circular reference to themselves via another object.
- Points to the
tags property of the parent property of itself, but that's also a Category, so it's just a circular reference to itself.
- Points to the
name property of the item1 property of Root, but that's also an Item, so again creates a circular reference to itself.
In both cases it looks like the schema properties should be an array of items which reference Tag or Item respectively.
Expected Behavior
The schemas do not generate validation errors.
Steps To Reproduce
Enter the contents of OpenApiDocumentLocalizationTests.VerifyOpenApiDocumentIsInvariant.verified.txt into editor.swagger.io.
Exceptions (if any)
No response
.NET Version
10.0.100-preview.7.25322.101
Anything else?
No response
Is there an existing issue for this?
Describe the bug
To validate the changes made in #63052 I put the OpenAPI schema into editor.swagger.io to see if the schema for JSON Patch had any validation errors (it does not).
However, amongst a few schema errors that are found in the document that aren't just artifacts of testing, I found two that appear to be actual issues:
Semantic error at components.schemas.Category.properties.tags.$ref - $refs must reference a valid location in the documentfromaspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/snapshots/OpenApiDocumentLocalizationTests.VerifyOpenApiDocumentIsInvariant.verified.txt
Line 1362 in f91de94
Semantic error at components.schemas.Item.properties.name.$ref - $refs must reference a valid location in the documentfromaspnetcore/src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/snapshots/OpenApiDocumentLocalizationTests.VerifyOpenApiDocumentIsInvariant.verified.txt
Line 1427 in f91de94
These correlate to these parts of the code:
aspnetcore/src/OpenApi/sample/Endpoints/MapSchemasEndpoints.cs
Line 51 in c103a03
aspnetcore/src/OpenApi/sample/Endpoints/MapSchemasEndpoints.cs
Line 73 in c103a03
Both of these properties are arrays and appear to generate a circular reference to themselves via another object.
tagsproperty of theparentproperty of itself, but that's also aCategory, so it's just a circular reference to itself.nameproperty of theitem1property ofRoot, but that's also anItem, so again creates a circular reference to itself.In both cases it looks like the schema properties should be an array of items which reference
TagorItemrespectively.Expected Behavior
The schemas do not generate validation errors.
Steps To Reproduce
Enter the contents of OpenApiDocumentLocalizationTests.VerifyOpenApiDocumentIsInvariant.verified.txt into editor.swagger.io.
Exceptions (if any)
No response
.NET Version
10.0.100-preview.7.25322.101
Anything else?
No response