@@ -18,115 +18,63 @@ namespace Microsoft.OpenApi.Models
1818 /// </summary>
1919 public class OpenApiComponents : IOpenApiSerializable , IOpenApiExtensible
2020 {
21- private Lazy < IDictionary < string , IOpenApiSchema > > ? _schemas = new ( ( ) => new Dictionary < string , IOpenApiSchema > ( StringComparer . Ordinal ) ) ;
2221 /// <summary>
2322 /// An object to hold reusable <see cref="IOpenApiSchema"/> Objects.
2423 /// </summary>
25- public IDictionary < string , IOpenApiSchema > ? Schemas
26- {
27- get => _schemas ? . Value ;
28- set => _schemas = value is null ? null : new ( ( ) => value ) ;
29- }
24+ public IDictionary < string , IOpenApiSchema > ? Schemas { get ; set ; } = new Dictionary < string , IOpenApiSchema > ( ) ;
3025
31- private Lazy < IDictionary < string , IOpenApiResponse > > ? _responses = new ( ( ) => new Dictionary < string , IOpenApiResponse > ( StringComparer . Ordinal ) ) ;
3226 /// <summary>
3327 /// An object to hold reusable <see cref="IOpenApiResponse"/> Objects.
3428 /// </summary>
35- public IDictionary < string , IOpenApiResponse > ? Responses
36- {
37- get => _responses ? . Value ;
38- set => _responses = value is null ? null : new ( ( ) => value ) ;
39- }
29+ public IDictionary < string , IOpenApiResponse > ? Responses { get ; set ; } = new Dictionary < string , IOpenApiResponse > ( ) ;
4030
41- private Lazy < IDictionary < string , IOpenApiParameter > > ? _parameters = new ( ( ) => new Dictionary < string , IOpenApiParameter > ( StringComparer . Ordinal ) ) ;
4231 /// <summary>
4332 /// An object to hold reusable <see cref="IOpenApiParameter"/> Objects.
4433 /// </summary>
45- public IDictionary < string , IOpenApiParameter > ? Parameters
46- {
47- get => _parameters ? . Value ;
48- set => _parameters = value is null ? null : new ( ( ) => value ) ;
49- }
34+ public IDictionary < string , IOpenApiParameter > ? Parameters { get ; set ; } =
35+ new Dictionary < string , IOpenApiParameter > ( ) ;
5036
51- private Lazy < IDictionary < string , IOpenApiExample > > ? _examples = new ( ( ) => new Dictionary < string , IOpenApiExample > ( StringComparer . Ordinal ) ) ;
5237 /// <summary>
5338 /// An object to hold reusable <see cref="OpenApiExample"/> Objects.
5439 /// </summary>
55- public IDictionary < string , IOpenApiExample > ? Examples
56- {
57- get => _examples ? . Value ;
58- set => _examples = value is null ? null : new ( ( ) => value ) ;
59- }
40+ public IDictionary < string , IOpenApiExample > ? Examples { get ; set ; } = new Dictionary < string , IOpenApiExample > ( ) ;
6041
61- private Lazy < IDictionary < string , IOpenApiRequestBody > > ? _requestBodies = new ( ( ) => new Dictionary < string , IOpenApiRequestBody > ( StringComparer . Ordinal ) ) ;
6242 /// <summary>
6343 /// An object to hold reusable <see cref="IOpenApiRequestBody"/> Objects.
6444 /// </summary>
65- public IDictionary < string , IOpenApiRequestBody > ? RequestBodies
66- {
67- get => _requestBodies ? . Value ;
68- set => _requestBodies = value is null ? null : new ( ( ) => value ) ;
69- }
45+ public IDictionary < string , IOpenApiRequestBody > ? RequestBodies { get ; set ; } =
46+ new Dictionary < string , IOpenApiRequestBody > ( ) ;
7047
71- private Lazy < IDictionary < string , IOpenApiHeader > > ? _headers = new ( ( ) => new Dictionary < string , IOpenApiHeader > ( StringComparer . Ordinal ) ) ;
7248 /// <summary>
7349 /// An object to hold reusable <see cref="IOpenApiHeader"/> Objects.
7450 /// </summary>
75- public IDictionary < string , IOpenApiHeader > ? Headers
76- {
77- get => _headers ? . Value ;
78- set => _headers = value is null ? null : new ( ( ) => value ) ;
79- }
51+ public IDictionary < string , IOpenApiHeader > ? Headers { get ; set ; } = new Dictionary < string , IOpenApiHeader > ( ) ;
8052
81- private Lazy < IDictionary < string , IOpenApiSecurityScheme > > ? _securitySchemes = new ( ( ) => new Dictionary < string , IOpenApiSecurityScheme > ( StringComparer . Ordinal ) ) ;
8253 /// <summary>
8354 /// An object to hold reusable <see cref="IOpenApiSecurityScheme"/> Objects.
8455 /// </summary>
85- public IDictionary < string , IOpenApiSecurityScheme > ? SecuritySchemes
86- {
87- get => _securitySchemes ? . Value ;
88- set => _securitySchemes = value is null ? null : new ( ( ) => value ) ;
89- }
56+ public IDictionary < string , IOpenApiSecurityScheme > ? SecuritySchemes { get ; set ; } =
57+ new Dictionary < string , IOpenApiSecurityScheme > ( ) ;
9058
91- private Lazy < IDictionary < string , IOpenApiLink > > ? _links = new ( ( ) => new Dictionary < string , IOpenApiLink > ( StringComparer . Ordinal ) ) ;
9259 /// <summary>
9360 /// An object to hold reusable <see cref="IOpenApiLink"/> Objects.
9461 /// </summary>
95- public IDictionary < string , IOpenApiLink > ? Links
96- {
97- get => _links ? . Value ;
98- set => _links = value is null ? null : new ( ( ) => value ) ;
99- }
62+ public IDictionary < string , IOpenApiLink > ? Links { get ; set ; } = new Dictionary < string , IOpenApiLink > ( ) ;
10063
101- private Lazy < IDictionary < string , IOpenApiCallback > > ? _callbacks = new ( ( ) => new Dictionary < string , IOpenApiCallback > ( StringComparer . Ordinal ) ) ;
10264 /// <summary>
10365 /// An object to hold reusable <see cref="OpenApiCallback"/> Objects.
10466 /// </summary>
105- public IDictionary < string , IOpenApiCallback > ? Callbacks
106- {
107- get => _callbacks ? . Value ;
108- set => _callbacks = value is null ? null : new ( ( ) => value ) ;
109- }
67+ public IDictionary < string , IOpenApiCallback > ? Callbacks { get ; set ; } = new Dictionary < string , IOpenApiCallback > ( ) ;
11068
111- private Lazy < IDictionary < string , IOpenApiPathItem > > ? _pathItems = new ( ( ) => new Dictionary < string , IOpenApiPathItem > ( StringComparer . Ordinal ) ) ;
11269 /// <summary>
11370 /// An object to hold reusable <see cref="IOpenApiPathItem"/> Object.
11471 /// </summary>
115- public IDictionary < string , IOpenApiPathItem > ? PathItems
116- {
117- get => _pathItems ? . Value ;
118- set => _pathItems = value is null ? null : new ( ( ) => value ) ;
119- }
72+ public IDictionary < string , IOpenApiPathItem > ? PathItems { get ; set ; } = new Dictionary < string , IOpenApiPathItem > ( ) ;
12073
121- private Lazy < IDictionary < string , IOpenApiExtension > > ? _extensions = new ( ( ) => new Dictionary < string , IOpenApiExtension > ( StringComparer . Ordinal ) ) ;
12274 /// <summary>
12375 /// This object MAY be extended with Specification Extensions.
12476 /// </summary>
125- public IDictionary < string , IOpenApiExtension > ? Extensions
126- {
127- get => _extensions ? . Value ;
128- set => _extensions = value is null ? null : new ( ( ) => value ) ;
129- }
77+ public IDictionary < string , IOpenApiExtension > ? Extensions { get ; set ; } = new Dictionary < string , IOpenApiExtension > ( ) ;
13078
13179 /// <summary>
13280 /// Parameter-less constructor
0 commit comments