Skip to content

Commit 7f3be25

Browse files
committed
docs: adds information about async methods
Signed-off-by: Vincent Biret <[email protected]>
1 parent deea642 commit 7f3be25

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/upgrade-guide-2.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@ In v1, instances of `$ref` were resolved in a second pass of the document to ens
2323

2424
[How does this change the behaviour of external references?]
2525

26+
### Asynchronous API surface
27+
28+
Any method which results in input/output access (memory, network, storage) is now Async and returns a `Task<Result>` to avoid any blocking calls an improve concurrency.
29+
30+
For example:
31+
32+
```csharp
33+
var result = myOperation.SerializeAsJson(OpenApiSpecVersion.OpenApi2_0);
34+
```
35+
36+
Is now:
37+
38+
```csharp
39+
var result = await myOperation.SerializeAsJsonAsync(OpenApiSpecVersion.OpenApi2_0);
40+
```
41+
2642
## Reduced Dependencies
2743

2844
In OpenAPI v1, it was necessary to include the Microsoft.OpenApi.Readers library to be able to read OpenAPI descriptions in either YAML or JSON. In OpenAPI.NET v2, the core Microsoft.OpenAPI library can both read and write JSON. It is only necessary to use the newly renamed [Microsoft.OpenApi.YamlReader](https://www.nuget.org/packages/Microsoft.OpenApi.YamlReader/) library if you need YAML support. This allows teams who are only working in JSON to avoid the additional dependency and therefore eliminate all non-.NET library references.

0 commit comments

Comments
 (0)