You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AsyncAPI.NET SDK contains a useful object model for the AsyncAPI specification in .NET along with common serializers to extract raw AsyncAPI JSON and YAML documents from the model as well.
@@ -12,19 +12,30 @@ The AsyncAPI.NET SDK contains a useful object model for the AsyncAPI specificati
12
12
[Wiki and getting started guide](https://github.com/ByteBardOrg/AsyncAPI.NET/wiki)
13
13
14
14
## Installation
15
+
Generally you wan't to use Readers and Bindings.
16
+
They have however been split to allow for different scenarios without polluting with unnecesary packages.
* There is an extension on the AsyncApiDocument type which allows Serializing as well (`new AsyncApiDocument().SerializeAsJson()` or `new AsyncApiDocument().SerializeAsYaml()`
26
37
27
-
###Writing
38
+
## Writing
28
39
29
40
```csharp
30
41
varmyFirstAsyncApi=newAsyncApiDocument
@@ -83,7 +94,7 @@ var yaml = myFirstAsyncApi.SerializeAsYaml(AsyncApi);
83
94
```
84
95
85
96
86
-
###Reading
97
+
## Reading
87
98
88
99
There are 3 reader types
89
100
1. AsyncApiStringReader
@@ -128,8 +139,8 @@ var asyncApiDocument = new AsyncApiStringReader().Read(yaml, out var diagnostic)
128
139
All readers will write warnings and errors to the diagnostics.
129
140
130
141
131
-
###Reference Resolution
132
-
Internal references are resolved by default. This includes component and non-component references e.g `#/components/messages/MyMessage` and `#/servers/0`.
142
+
## Reference Resolution
143
+
Internal references are resolved by default. This includes component and non-component references e.g `#/components/messages/MyMessage` and `#/servers/0`.
133
144
External references can be resolved by setting `ReferenceResolution` to `ResolveAllReferences`.
134
145
The default implementation will resolve anything prefixed with `file://`, `http://` & `https://`, however a custom implementation can be made, by inhereting from the `IStreamLoader` interface and setting the `ExternalReferenceLoader` in the `AsyncApiReaderSettings`.
135
146
External references are always force converted to Json during resolution. This means that both yaml and json is supported - but not other serialization languages.
@@ -139,11 +150,9 @@ var settings = new AsyncApiReaderSettings { ReferenceResolution = ReferenceResol
0 commit comments