Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/OpenApi/src/Extensions/JsonNodeSchemaExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,16 @@ internal static void ApplyDefaultValue(this JsonNode schema, object? defaultValu
return;
}

var isReferencedSchema = schema[OpenApiConstants.SchemaId] is null;
var schemaAttribute = isReferencedSchema ? OpenApiConstants.RefDefaultAnnotation : OpenApiSchemaKeywords.DefaultKeyword;

if (defaultValue is null)
{
schema[OpenApiSchemaKeywords.DefaultKeyword] = null;
schema[schemaAttribute] = null;
}
else
{
schema[OpenApiSchemaKeywords.DefaultKeyword] = JsonSerializer.SerializeToNode(defaultValue, jsonTypeInfo);
schema[schemaAttribute] = JsonSerializer.SerializeToNode(defaultValue, jsonTypeInfo);
}
}

Expand Down
12 changes: 7 additions & 5 deletions src/OpenApi/src/Extensions/OpenApiDocumentExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,27 @@ internal static class OpenApiDocumentExtensions
/// <returns>An <see cref="IOpenApiSchema"/> with a reference to the stored schema.</returns>
public static IOpenApiSchema AddOpenApiSchemaByReference(this OpenApiDocument document, string schemaId, IOpenApiSchema schema)
{
document.Components ??= new();
document.Components.Schemas ??= new Dictionary<string, IOpenApiSchema>();
document.Components.Schemas[schemaId] = schema;
// Make sure the document has a workspace,
// AddComponent will add it to the workspace when adding the component.
document.Workspace ??= new();
var location = document.BaseUri + "/components/schemas/" + schemaId;
document.Workspace.RegisterComponentForDocument(document, schema, location);
// AddComponent will only add the schema if it doesn't already exist.
document.AddComponent(schemaId, schema);

object? description = null;
object? example = null;
object? defaultAnnotation = null;
if (schema is OpenApiSchema actualSchema)
{
actualSchema.Metadata?.TryGetValue(OpenApiConstants.RefDescriptionAnnotation, out description);
actualSchema.Metadata?.TryGetValue(OpenApiConstants.RefExampleAnnotation, out example);
actualSchema.Metadata?.TryGetValue(OpenApiConstants.RefDefaultAnnotation, out defaultAnnotation);
}

return new OpenApiSchemaReference(schemaId, document)
{
Description = description as string,
Examples = example is JsonNode exampleJson ? [exampleJson] : null,
Default = defaultAnnotation as JsonNode,
};
}
}
6 changes: 5 additions & 1 deletion src/OpenApi/src/Schemas/OpenApiJsonSchema.Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,11 @@ public static void ReadProperty(ref Utf8JsonReader reader, string propertyName,
schema.Metadata ??= new Dictionary<string, object>();
schema.Metadata[OpenApiConstants.RefDescriptionAnnotation] = reader.GetString() ?? string.Empty;
break;

case OpenApiConstants.RefDefaultAnnotation:
reader.Read();
schema.Metadata ??= new Dictionary<string, object>();
schema.Metadata[OpenApiConstants.RefDefaultAnnotation] = ReadJsonNode(ref reader)!;
break;
default:
reader.Skip();
break;
Expand Down
1 change: 1 addition & 0 deletions src/OpenApi/src/Services/OpenApiConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ internal static class OpenApiConstants
internal const string DescriptionId = "x-aspnetcore-id";
internal const string SchemaId = "x-schema-id";
internal const string RefId = "x-ref-id";
internal const string RefDefaultAnnotation = "x-ref-default";
internal const string RefDescriptionAnnotation = "x-ref-description";
internal const string RefExampleAnnotation = "x-ref-example";
internal const string RefKeyword = "$ref";
Expand Down
24 changes: 19 additions & 5 deletions src/OpenApi/src/Services/Schemas/OpenApiSchemaService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,20 @@ internal static IOpenApiSchema ResolveReferenceForSchema(OpenApiDocument documen
{
var schema = UnwrapOpenApiSchema(inputSchema);

if (inputSchema is OpenApiSchema && schema.Metadata is not null &&
!schema.Metadata.ContainsKey(OpenApiConstants.RefId) &&
schema.Metadata.TryGetValue(OpenApiConstants.SchemaId, out var referenceId) &&
referenceId is string referenceIdString)
{
var targetReferenceId = baseSchemaId is not null
? $"{baseSchemaId}{referenceIdString}"
: referenceIdString;
if (!string.IsNullOrEmpty(targetReferenceId))
{
document.AddOpenApiSchemaByReference(targetReferenceId, schema);
}
}

if (schema.Metadata is not null &&
schema.Metadata.TryGetValue(OpenApiConstants.SchemaId, out var resolvedBaseSchemaId))
{
Expand Down Expand Up @@ -347,14 +361,14 @@ internal static IOpenApiSchema ResolveReferenceForSchema(OpenApiDocument documen
// we don't want to replace the top-level inline schema with a reference to itself. We want to replace
// inline schemas to reference schemas for all schemas referenced in the top-level schema though (such as
// `allOf`, `oneOf`, `anyOf`, `items`, `properties`, etc.) which is why `isTopLevel` is only set once.
if (schema is OpenApiSchema && schema.Metadata is not null &&
if (inputSchema is OpenApiSchema && schema.Metadata is not null &&
!schema.Metadata.ContainsKey(OpenApiConstants.RefId) &&
schema.Metadata.TryGetValue(OpenApiConstants.SchemaId, out var referenceId) &&
referenceId is string referenceIdString)
schema.Metadata.TryGetValue(OpenApiConstants.SchemaId, out var referenceId2) &&
referenceId2 is string referenceIdString2)
{
var targetReferenceId = baseSchemaId is not null
? $"{baseSchemaId}{referenceIdString}"
: referenceIdString;
? $"{baseSchemaId}{referenceIdString2}"
: referenceIdString2;
if (!string.IsNullOrEmpty(targetReferenceId))
{
return document.AddOpenApiSchemaByReference(targetReferenceId, schema);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -984,8 +984,9 @@ private void VerifyOptionalEnum(OpenApiDocument document)
var property = properties["status"];

Assert.NotNull(property);
Assert.Equal(3, property.Enum.Count);
Assert.Equal("Approved", property.Default.GetValue<string>());
var statusReference = Assert.IsType<OpenApiSchemaReference>(property);
Assert.Equal(3, statusReference.RecursiveTarget.Enum.Count);
Assert.Equal("Approved", statusReference.Default.GetValue<string>());
}

[ApiController]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,38 @@
});
}

// Test for: https://github.com/dotnet/aspnetcore/issues/64048
public static object[][] CircularReferencesWithArraysHandlers =>
[
[(CircularReferenceWithArrayRootOrderArrayFirst dto) => { }],
[(CircularReferenceWithArrayRootOrderArrayLast dto) => { }],
];

[Theory]
[MemberData(nameof(CircularReferencesWithArraysHandlers))]
public async Task HandlesCircularReferencesWithArraysRegardlessOfPropertyOrder(Delegate requestHandler)
{
var builder = CreateBuilder();
builder.MapPost("/", requestHandler);

await VerifyOpenApiDocument(builder, (OpenApiDocument document) =>
{
Assert.NotNull(document.Components?.Schemas);
var schema = document.Components.Schemas["CircularReferenceWithArrayModel"];
Assert.Equal(JsonSchemaType.Object, schema.Type);
Assert.NotNull(schema.Properties);
Assert.Collection(schema.Properties,
property =>
{
Assert.Equal("selfArray", property.Key);
var arraySchema = Assert.IsType<OpenApiSchema>(property.Value);
Assert.Equal(JsonSchemaType.Array, arraySchema.Type);
var itemReference = Assert.IsType<OpenApiSchemaReference>(arraySchema.Items);
Assert.Equal("#/components/schemas/CircularReferenceWithArrayModel", itemReference.Reference.ReferenceV3);
});
});
}

// Test models for issue 61194
private class Config
{
Expand Down Expand Up @@ -1203,5 +1235,23 @@
{
public int Id { get; set; }
}

// Test models for issue 64048
public class CircularReferenceWithArrayRootOrderArrayLast
{
public CircularReferenceWithArrayModel Item { get; set; }

Check failure on line 1242 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: macOS)

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1242

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1242,48): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'Item' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1242 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: Ubuntu x64)

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1242

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1242,48): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'Item' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1242 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: Ubuntu x64)

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1242

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1242,48): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'Item' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1242 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: macOS)

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1242

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1242,48): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'Item' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1242 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1242

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1242,48): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'Item' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1242 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1242

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1242,48): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'Item' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
public ICollection<CircularReferenceWithArrayModel> ItemArray { get; set; }

Check failure on line 1243 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: macOS)

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1243

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1243,61): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'ItemArray' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1243 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: Ubuntu x64)

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1243

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1243,61): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'ItemArray' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1243 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: Ubuntu x64)

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1243

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1243,61): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'ItemArray' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1243 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: macOS)

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1243

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1243,61): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'ItemArray' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1243 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1243

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1243,61): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'ItemArray' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
}

public class CircularReferenceWithArrayRootOrderArrayFirst
{
public ICollection<CircularReferenceWithArrayModel> ItemArray { get; set; }

Check failure on line 1248 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: macOS)

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1248

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1248,61): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'ItemArray' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1248 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: Ubuntu x64)

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1248

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1248,61): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'ItemArray' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1248 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: Ubuntu x64)

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1248

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1248,61): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'ItemArray' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1248 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: macOS)

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1248

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1248,61): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'ItemArray' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1248 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1248

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1248,61): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'ItemArray' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1248 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1248

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1248,61): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'ItemArray' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
public CircularReferenceWithArrayModel Item { get; set; }

Check failure on line 1249 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: macOS)

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1249

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1249,48): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'Item' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1249 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: Ubuntu x64)

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1249

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1249,48): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'Item' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1249 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: Ubuntu x64)

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1249

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1249,48): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'Item' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1249 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: macOS)

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1249

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1249,48): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'Item' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1249 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1249

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1249,48): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'Item' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
}

public class CircularReferenceWithArrayModel
{
public ICollection<CircularReferenceWithArrayModel> SelfArray { get; set; }

Check failure on line 1254 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: macOS)

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1254

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1254,61): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'SelfArray' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1254 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: Ubuntu x64)

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1254

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1254,61): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'SelfArray' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1254 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: macOS)

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1254

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1254,61): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'SelfArray' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 1254 in src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs#L1254

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/Implementations/OpenApiSchemaReferenceTransformerTests.cs(1254,61): error CS8618: (NETCORE_ENGINEERING_TELEMETRY=Build) Non-nullable property 'SelfArray' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
}
}
#nullable restore
Loading