|
4 | 4 | using System;
|
5 | 5 | using System.Collections.Generic;
|
6 | 6 | using Microsoft.OpenApi.Interfaces;
|
| 7 | +using Microsoft.OpenApi.Models.Interfaces; |
7 | 8 | using Microsoft.OpenApi.Models.References;
|
8 | 9 | using Microsoft.OpenApi.Writers;
|
9 | 10 |
|
@@ -35,7 +36,7 @@ public class OpenApiComponents : IOpenApiSerializable, IOpenApiExtensible
|
35 | 36 | /// <summary>
|
36 | 37 | /// An object to hold reusable <see cref="OpenApiExample"/> Objects.
|
37 | 38 | /// </summary>
|
38 |
| - public virtual IDictionary<string, OpenApiExample>? Examples { get; set; } = new Dictionary<string, OpenApiExample>(); |
| 39 | + public virtual IDictionary<string, IOpenApiExample>? Examples { get; set; } = new Dictionary<string, IOpenApiExample>(); |
39 | 40 |
|
40 | 41 | /// <summary>
|
41 | 42 | /// An object to hold reusable <see cref="OpenApiRequestBody"/> Objects.
|
@@ -87,7 +88,7 @@ public OpenApiComponents(OpenApiComponents? components)
|
87 | 88 | Schemas = components?.Schemas != null ? new Dictionary<string, OpenApiSchema>(components.Schemas) : null;
|
88 | 89 | Responses = components?.Responses != null ? new Dictionary<string, OpenApiResponse>(components.Responses) : null;
|
89 | 90 | Parameters = components?.Parameters != null ? new Dictionary<string, OpenApiParameter>(components.Parameters) : null;
|
90 |
| - Examples = components?.Examples != null ? new Dictionary<string, OpenApiExample>(components.Examples) : null; |
| 91 | + Examples = components?.Examples != null ? new Dictionary<string, IOpenApiExample>(components.Examples) : null; |
91 | 92 | RequestBodies = components?.RequestBodies != null ? new Dictionary<string, OpenApiRequestBody>(components.RequestBodies) : null;
|
92 | 93 | Headers = components?.Headers != null ? new Dictionary<string, OpenApiHeader>(components.Headers) : null;
|
93 | 94 | SecuritySchemes = components?.SecuritySchemes != null ? new Dictionary<string, OpenApiSecurityScheme>(components.SecuritySchemes) : null;
|
@@ -160,7 +161,7 @@ public void SerializeAsV3(IOpenApiWriter writer)
|
160 | 161 | /// Serialize <see cref="OpenApiComponents"/>.
|
161 | 162 | /// </summary>
|
162 | 163 | private void SerializeInternal(IOpenApiWriter writer, OpenApiSpecVersion version,
|
163 |
| - Action<IOpenApiWriter, IOpenApiSerializable> callback, Action<IOpenApiWriter, IOpenApiReferenceable> action) |
| 164 | + Action<IOpenApiWriter, IOpenApiSerializable> callback, Action<IOpenApiWriter, IOpenApiReferenceHolder> action) |
164 | 165 | {
|
165 | 166 | // Serialize each referenceable object as full object without reference if the reference in the object points to itself.
|
166 | 167 | // If the reference exists but points to other objects, the object is serialized to just that reference.
|
|
0 commit comments