8
8
using Microsoft . OpenApi . Models . References ;
9
9
using Microsoft . OpenApi . Writers ;
10
10
11
+ #nullable enable
11
12
12
13
namespace Microsoft . OpenApi . Models
13
14
{
@@ -19,60 +20,60 @@ public class OpenApiComponents : IOpenApiSerializable, IOpenApiExtensible
19
20
/// <summary>
20
21
/// An object to hold reusable <see cref="OpenApiSchema"/> Objects.
21
22
/// </summary>
22
- public IDictionary < string , OpenApiSchema > Schemas { get ; set ; } = new Dictionary < string , OpenApiSchema > ( ) ;
23
+ public IDictionary < string , OpenApiSchema > ? Schemas { get ; set ; } = new Dictionary < string , OpenApiSchema > ( ) ;
23
24
24
25
/// <summary>
25
26
/// An object to hold reusable <see cref="OpenApiResponse"/> Objects.
26
27
/// </summary>
27
- public virtual IDictionary < string , OpenApiResponse > Responses { get ; set ; } = new Dictionary < string , OpenApiResponse > ( ) ;
28
+ public virtual IDictionary < string , OpenApiResponse > ? Responses { get ; set ; } = new Dictionary < string , OpenApiResponse > ( ) ;
28
29
29
30
/// <summary>
30
31
/// An object to hold reusable <see cref="OpenApiParameter"/> Objects.
31
32
/// </summary>
32
- public virtual IDictionary < string , OpenApiParameter > Parameters { get ; set ; } =
33
+ public virtual IDictionary < string , OpenApiParameter > ? Parameters { get ; set ; } =
33
34
new Dictionary < string , OpenApiParameter > ( ) ;
34
35
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 , OpenApiExample > ? Examples { get ; set ; } = new Dictionary < string , OpenApiExample > ( ) ;
39
40
40
41
/// <summary>
41
42
/// An object to hold reusable <see cref="OpenApiRequestBody"/> Objects.
42
43
/// </summary>
43
- public virtual IDictionary < string , OpenApiRequestBody > RequestBodies { get ; set ; } =
44
+ public virtual IDictionary < string , OpenApiRequestBody > ? RequestBodies { get ; set ; } =
44
45
new Dictionary < string , OpenApiRequestBody > ( ) ;
45
46
46
47
/// <summary>
47
48
/// An object to hold reusable <see cref="OpenApiHeader"/> Objects.
48
49
/// </summary>
49
- public virtual IDictionary < string , OpenApiHeader > Headers { get ; set ; } = new Dictionary < string , OpenApiHeader > ( ) ;
50
+ public virtual IDictionary < string , OpenApiHeader > ? Headers { get ; set ; } = new Dictionary < string , OpenApiHeader > ( ) ;
50
51
51
52
/// <summary>
52
53
/// An object to hold reusable <see cref="OpenApiSecurityScheme"/> Objects.
53
54
/// </summary>
54
- public virtual IDictionary < string , OpenApiSecurityScheme > SecuritySchemes { get ; set ; } =
55
+ public virtual IDictionary < string , OpenApiSecurityScheme > ? SecuritySchemes { get ; set ; } =
55
56
new Dictionary < string , OpenApiSecurityScheme > ( ) ;
56
57
57
58
/// <summary>
58
59
/// An object to hold reusable <see cref="OpenApiLink"/> Objects.
59
60
/// </summary>
60
- public virtual IDictionary < string , OpenApiLink > Links { get ; set ; } = new Dictionary < string , OpenApiLink > ( ) ;
61
+ public virtual IDictionary < string , OpenApiLink > ? Links { get ; set ; } = new Dictionary < string , OpenApiLink > ( ) ;
61
62
62
63
/// <summary>
63
64
/// An object to hold reusable <see cref="OpenApiCallback"/> Objects.
64
65
/// </summary>
65
- public virtual IDictionary < string , OpenApiCallback > Callbacks { get ; set ; } = new Dictionary < string , OpenApiCallback > ( ) ;
66
+ public virtual IDictionary < string , OpenApiCallback > ? Callbacks { get ; set ; } = new Dictionary < string , OpenApiCallback > ( ) ;
66
67
67
68
/// <summary>
68
69
/// An object to hold reusable <see cref="OpenApiPathItem"/> Object.
69
70
/// </summary>
70
- public virtual IDictionary < string , OpenApiPathItem > PathItems { get ; set ; } = new Dictionary < string , OpenApiPathItem > ( ) ;
71
+ public virtual IDictionary < string , OpenApiPathItem > ? PathItems { get ; set ; } = new Dictionary < string , OpenApiPathItem > ( ) ;
71
72
72
73
/// <summary>
73
74
/// This object MAY be extended with Specification Extensions.
74
75
/// </summary>
75
- public virtual IDictionary < string , IOpenApiExtension > Extensions { get ; set ; } = new Dictionary < string , IOpenApiExtension > ( ) ;
76
+ public virtual IDictionary < string , IOpenApiExtension > ? Extensions { get ; set ; } = new Dictionary < string , IOpenApiExtension > ( ) ;
76
77
77
78
/// <summary>
78
79
/// Parameter-less constructor
@@ -82,7 +83,7 @@ public OpenApiComponents() { }
82
83
/// <summary>
83
84
/// Initializes a copy of an <see cref="OpenApiComponents"/> object
84
85
/// </summary>
85
- public OpenApiComponents ( OpenApiComponents components )
86
+ public OpenApiComponents ( OpenApiComponents ? components )
86
87
{
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 ;
0 commit comments