3
3
namespace LEGO . AsyncAPI . Models
4
4
{
5
5
using System . Collections . Generic ;
6
+ using Newtonsoft . Json ;
6
7
7
8
/// <summary>
8
9
/// This is the root document object for the API specification. It combines resource listing and API declaration together into one document.
@@ -12,22 +13,25 @@ public class AsyncApiDocument : IExtensible
12
13
/// <summary>
13
14
/// REQUIRED. Specifies the AsyncAPI Specification version being used.
14
15
/// </summary>
16
+ [ JsonProperty ( "asyncapi" ) ]
15
17
public string AsyncApi { get ; set ; }
16
18
17
19
/// <summary>
18
20
/// Identifier of the application the AsyncAPI document is defining.
19
21
/// </summary>
22
+ [ JsonProperty ( "id" ) ]
20
23
public string Id { get ; set ; }
21
24
22
25
/// <summary>
23
26
/// REQUIRED. Provides metadata about the API. The metadata can be used by the clients if needed.
24
27
/// </summary>
28
+ [ JsonProperty ( "info" ) ]
25
29
public Info Info { get ; set ; }
26
30
27
31
/// <summary>
28
32
/// Provides connection details of servers. Field pattern ^[A-Za-z0-9_\-]+$.
29
33
/// </summary>
30
- public IDictionary < string , Server > Servers { get ; set ; } = new Dictionary < string , Server > ( ) ;
34
+ public IDictionary < string , Server > Servers { get ; set ; }
31
35
32
36
/// <summary>
33
37
/// Default content type to use when encoding/decoding a message's payload.
@@ -41,6 +45,7 @@ public class AsyncApiDocument : IExtensible
41
45
/// <summary>
42
46
/// REQUIRED. The available channels and messages for the API.
43
47
/// </summary>
48
+ [ JsonProperty ( "channels" ) ]
44
49
public IDictionary < string , Channel > Channels { get ; set ; } = new Dictionary < string , Channel > ( ) ;
45
50
46
51
/// <summary>
@@ -51,14 +56,15 @@ public class AsyncApiDocument : IExtensible
51
56
/// <summary>
52
57
/// A list of tags used by the specification with additional metadata. Each tag name in the list MUST be unique.
53
58
/// </summary>
54
- public IList < Tag > Tags { get ; set ; } = new List < Tag > ( ) ;
59
+ public IList < Tag > Tags { get ; set ; }
55
60
56
61
/// <summary>
57
62
/// Additional external documentation.
58
63
/// </summary>
59
64
public ExternalDocumentation ExternalDocs { get ; set ; }
60
65
61
66
/// <inheritdoc/>
67
+ [ JsonIgnore ]
62
68
public IDictionary < string , string > Extensions { get ; set ; } = new Dictionary < string , string > ( ) ;
63
69
}
64
70
}
0 commit comments