Skip to content

Commit 1870fb2

Browse files
authored
docs: update readme
1 parent 5445a8a commit 1870fb2

1 file changed

Lines changed: 20 additions & 11 deletions

File tree

README.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ This serves as the official future of AsyncAPI.NET.
33
To be able to give the level of support I want, I have had to fork my original work from the ByteBard Group, and create my own.
44
This is unfortunate, but after much back and not a lot of forth, I have decided that it was time.
55

6-
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/ByteBard/AsyncAPI.NET/ci.yml?label=Build%20%26%20Test&style=for-the-badge)
6+
[![Build & Test](https://github.com/ByteBardOrg/AsyncAPI.NET/actions/workflows/ci.yml/badge.svg)](https://github.com/ByteBardOrg/AsyncAPI.NET/actions/workflows/ci.yml)
77

88

99
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
1212
[Wiki and getting started guide](https://github.com/ByteBardOrg/AsyncAPI.NET/wiki)
1313

1414
## 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.
1517

1618
Install the NuGet packages:
17-
TODO
19+
### ByteBard.AsyncAPI.NET
20+
[![Nuget](https://img.shields.io/nuget/v/ByteBard.AsyncAPI.NET?label=ByteBard.AsyncAPI.NET&style=for-the-badge)](https://www.nuget.org/packages/ByteBard.AsyncAPI.NET/)
21+
[![Nuget](https://img.shields.io/nuget/vpre/ByteBard.AsyncAPI.NET?label=ByteBard.AsyncAPI.NET-Preview&style=for-the-badge)](https://www.nuget.org/packages/ByteBard.AsyncAPI.NET/)
1822

19-
## Example Usage
23+
### ByteBard.AsyncAPI.Readers
24+
[![Nuget](https://img.shields.io/nuget/v/ByteBard.AsyncAPI.NET.Readers?label=ByteBard.AsyncAPI.Readers&style=for-the-badge)](https://www.nuget.org/packages/AsyncAPI.NET.Readers/)
25+
[![Nuget](https://img.shields.io/nuget/vpre/ByteBard.AsyncAPI.NET.Readers?label=ByteBard.AsyncAPI.Readers-Preview&style=for-the-badge)](https://www.nuget.org/packages/AsyncAPI.NET.Readers/)
2026

27+
### ByteBard.AsyncAPI.Bindings
28+
[![Nuget](https://img.shields.io/nuget/v/ByteBard.AsyncAPI.NET.Bindings?label=ByteBard.AsyncAPI.Bindings&style=for-the-badge)](https://www.nuget.org/packages/ByteBard.AsyncAPI.NET.Bindings/)
29+
[![Nuget](https://img.shields.io/nuget/vpre/ByteBard.AsyncAPI.NET.Bindings?label=ByteBard.AsyncAPI.Bindings-Preview&style=for-the-badge)](https://www.nuget.org/packages/ByteBard.AsyncAPI.NET.Bindings/)
30+
31+
# Example Usage
2132
Main classes to know:
2233

2334
* AsyncApiStringReader
2435
* AsyncApiStringWriter
2536
* There is an extension on the AsyncApiDocument type which allows Serializing as well (`new AsyncApiDocument().SerializeAsJson()` or `new AsyncApiDocument().SerializeAsYaml()`
2637

27-
### Writing
38+
## Writing
2839

2940
```csharp
3041
var myFirstAsyncApi = new AsyncApiDocument
@@ -83,7 +94,7 @@ var yaml = myFirstAsyncApi.SerializeAsYaml(AsyncApi);
8394
```
8495

8596

86-
### Reading
97+
## Reading
8798

8899
There are 3 reader types
89100
1. AsyncApiStringReader
@@ -128,8 +139,8 @@ var asyncApiDocument = new AsyncApiStringReader().Read(yaml, out var diagnostic)
128139
All readers will write warnings and errors to the diagnostics.
129140

130141

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`.
133144
External references can be resolved by setting `ReferenceResolution` to `ResolveAllReferences`.
134145
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`.
135146
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
139150
var document = new AsyncApiStringReader(settings).Read(json, out var diagnostics);
140151
```
141152

142-
143-
144153
Reference resolution can be disabled by setting `ReferenceResolution` to `DoNotResolveReferences`.
145154

146-
### Bindings
155+
## Bindings
147156
To add support for reading bindings, simply add the bindings you wish to support, to the `Bindings` collection of `AsyncApiReaderSettings`.
148157
There is a nifty helper to add different types of bindings, or like in the example `All` of them.
149158

@@ -158,7 +167,7 @@ var asyncApiDocument = new AsyncApiStringReader(settings).Read(yaml, out var dia
158167
* [OpenAPI.Net](https://github.com/microsoft/OpenAPI.NET) - [MIT License](https://github.com/microsoft/OpenAPI.NET/blob/vnext/LICENSE)
159168
* [YamlDotNet](https://github.com/aaubry/YamlDotNet) - [MIT License](https://github.com/aaubry/YamlDotNet/blob/master/LICENSE.txt)
160169
* [JsonPointer.Net](https://github.com/json-everything/json-everything) - [MIT License](https://github.com/json-everything/json-everything/blob/master/LICENSE)
161-
170+
162171
## Contribution
163172

164173
This project welcomes contributions and suggestions.

0 commit comments

Comments
 (0)