|
3 | 3 |
|
4 | 4 | namespace ApiCodeGenerator.AsyncApi.DOM |
5 | 5 | { |
6 | | -#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. |
7 | 6 | public class Components |
8 | 7 | { |
9 | | - [JsonProperty("messages", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] |
10 | | - public IDictionary<string, Message> Messages { get; set; } |
| 8 | + [JsonProperty("messages", DefaultValueHandling = DefaultValueHandling.Populate)] |
| 9 | + public IDictionary<string, Message> Messages { get; } = new Dictionary<string, Message>(); |
11 | 10 |
|
12 | | - [JsonProperty("parameters", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] |
13 | | - public IDictionary<string, Parameter> Parameters { get; set; } |
| 11 | + [JsonProperty("parameters", DefaultValueHandling = DefaultValueHandling.Populate)] |
| 12 | + public IDictionary<string, Parameter> Parameters { get; } = new Dictionary<string, Parameter>(); |
14 | 13 |
|
15 | | - [JsonProperty("schemas", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] |
16 | | - public IDictionary<string, JsonSchema> Schemas { get; set; } |
| 14 | + [JsonProperty("schemas", DefaultValueHandling = DefaultValueHandling.Populate)] |
| 15 | + public IDictionary<string, JsonSchema> Schemas { get; } = new Dictionary<string, JsonSchema>(); |
| 16 | + |
| 17 | + [JsonProperty("servers", DefaultValueHandling = DefaultValueHandling.Populate)] |
| 18 | + public IDictionary<string, Server> Servers { get; } = new Dictionary<string, Server>(); |
| 19 | + |
| 20 | + [JsonProperty("serverVariables", DefaultValueHandling = DefaultValueHandling.Populate)] |
| 21 | + public IDictionary<string, ServerVariable> ServerVariables { get; } = new Dictionary<string, ServerVariable>(); |
17 | 22 | } |
18 | | -#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. |
19 | 23 | } |
0 commit comments