Skip to content

Commit eb38d41

Browse files
authored
Update docs (#249)
1 parent fa29cf6 commit eb38d41

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

docs/Customization.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Customizations
22

3-
OpenAPI and Swagger type providers one or several provided API client (depending on the value of `IgnoreControllerPrefix`).
4-
Each provided API client is subclass of `ProvidedApiClientBase` that allow you control and customize HTTP calls.
3+
OpenAPI and Swagger type providers one or several provided API clients (depending on the value of `IgnoreControllerPrefix`).
4+
Each provided API client is a subclass of `ProvidedApiClientBase` that allows you to control and customize HTTP calls.
55

66
```fsharp
77
type ProvidedApiClientBase(httpClient: HttpClient) =
@@ -11,11 +11,11 @@ type ProvidedApiClientBase(httpClient: HttpClient) =
1111
abstract member Deserialize: string * Type -> obj
1212
```
1313

14-
Snippet shows only most important parts of `ProvidedApiClientBase`, the full source code provide default implementation for `Serialize` & `Deserialize` methods that tightly coupled with [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json/).
14+
The snippet shows only the most important parts of `ProvidedApiClientBase`, the full source code provides a default implementation for `Serialize` & `Deserialize` methods that tightly coupled with [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json/).
1515

1616
**Key features:**
17-
1. You can provide your own instance of `HttpClient` during API client construction and control HTTP request execution (If you will not provide `HttpClient`, type provider create default one for you).
18-
2. `Serialize` and `Deserialize` methods are abstract. If you are not happy with default `JsonSerializerSettings` you can override them and configure `Newtonsoft.Json` as you like.
17+
1. You can provide your own instance of `HttpClient` during API client construction and control HTTP request execution (If you will not provide `HttpClient`, the type provider creates the default one for you).
18+
2. `Serialize` and `Deserialize` methods are abstract. If you are not happy with the default `JsonSerializerSettings` you can override them and configure `Newtonsoft.Json` as you like.
1919

2020
## Request interception
2121

@@ -55,7 +55,7 @@ let main argv =
5555

5656
## Authentication
5757

58-
Authentication is just a special case `Request interception`. Your custom `DelegatingHandler` is fully responsible for management of authentication information (attach Authentication Header, authentication cookie, invalidate it and etc.).
58+
Authentication is just a special case of `Request interception`. Your custom `DelegatingHandler` is fully responsible for the management of authentication information (attach Authentication Header, authentication cookie, invalidate it and etc.).
5959

6060
```fsharp {highlight:['4-6']}
6161
type AuthHandler(messageHandler) =
@@ -80,7 +80,7 @@ let client = PetStore.Client(httpClient)
8080

8181
## Serialization
8282

83-
Serialization is also quite flexible. All you need it to define your own type for API client that will be subclass of API client generated by type provider and override `Serialize` and `Deserialize` members.
83+
Serialization is also quite flexible. All you need is to define your own type for API client that will be a subclass of API client generated by the type provider and override `Serialize` and `Deserialize` members.
8484

8585
<Note type="note">
8686

@@ -132,4 +132,4 @@ let main argv =
132132
|> Async.RunSynchronously
133133
0
134134
135-
```
135+
```

docs/OpenApiClientProvider.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OpenAPI Client Provider
22

3-
OpenApiClientProvider is generative F# Type Provider, build on top of [Microsoft.OpenApi.Readers](https://www.nuget.org/packages/Microsoft.OpenApi.Readers/) schema parser that supports 3.0 and 2.0 schema formats.
3+
OpenApiClientProvider is a generative F# Type Provider, built on top of [Microsoft.OpenApi.Readers](https://www.nuget.org/packages/Microsoft.OpenApi.Readers/) schema parser that supports 3.0 and 2.0 schema formats.
44

55
```fsharp
66
open SwaggerProvider
@@ -12,7 +12,7 @@ let client = PetStore.Client()
1212

1313
## Parameters
1414

15-
`OpenApiClientProvider` supports following configuration parametes
15+
`OpenApiClientProvider` supports the following configuration parameters
1616

1717
| Parameter | Description |
1818
|-----------|-------------|
@@ -43,15 +43,15 @@ type PetStore = OpenApiClientProvider<Schema>
4343
let main argv =
4444
// `UseCookies = false` is required if you use Cookie Parameters
4545
let handler = new HttpClientHandler (UseCookies = false)
46-
// `BaseAddress` uri should ends with '/' because TP generate relative uri
46+
// `BaseAddress` uri should end with '/' because TP generate relative uri
4747
let baseUri = Uri("https://petstore.swagger.io/v2/")
4848
use httpClient = new HttpClient(handler, true, BaseAddress=baseUri)
49-
// You can provide your instance of `HttpClient` to provided api client
49+
// You can provide your instance of `HttpClient` to the provided api client
5050
// or change it any time in runtime using `client.HttpClient` property
5151
let client = PetStore.Client(httpClient)
5252
5353
task {
54-
// Create new instance of provided type and add to store
54+
// Create a new instance of the provided type and add to store
5555
let pet = PetStore.Pet(Id = Some(24L), Name = "Shani")
5656
do! client.AddPet(pet)
5757
@@ -62,4 +62,4 @@ let main argv =
6262
|> Async.AwaitTask
6363
|> Async.RunSynchronously
6464
0
65-
```
65+
```

docs/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
[![NuGet Badge](https://buildstats.info/nuget/SwaggerProvider?includePreReleases=true)](https://www.nuget.org/packages/SwaggerProvider)
33

4-
`SwaggerProvider` is an umbrella project for two F# generative Type Providers that generate object model and HTTP clients for APIs described by [OpenApi 3.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md) and [Swagger 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md) schemas
4+
`SwaggerProvider` is an umbrella project for two F# generative Type Providers that generate object models and HTTP clients for APIs described by [OpenApi 3.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md) and [Swagger 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md) schemas
55
- [OpenApiClientProvider](/OpenApiClientProvider) <Badge type="success">New</Badge> - uses [Microsoft.OpenApi.Readers](https://www.nuget.org/packages/Microsoft.OpenApi.Readers/) to parse schema. Support both OpenApi and Swagger schemas, but Swagger support is limited.
6-
- [SwaggerClientProvider](/SwaggerClientProvider) - uses custom old good Swagger 2.0 schema parser and tested on several hundreds schemas available in [APIs.guru](https://apis.guru/openapi-directory/) (Wikipedia for WEB APIs)
6+
- [SwaggerClientProvider](/SwaggerClientProvider) - uses custom old good Swagger 2.0 schema parser and tested on several hundred schemas available in [APIs.guru](https://apis.guru/openapi-directory/) (Wikipedia for WEB APIs)
77

8-
Type Providers support schemas in `JSON` & `YAML` formats and runs on `netcoreapp3.1` and `net46`.
8+
Type Providers support schemas in `JSON` & `YAML` formats and run on `netcoreapp3.1` and `net46`.
99

1010
### Getting started
1111

@@ -56,13 +56,13 @@ let main argv =
5656
0
5757
```
5858

59-
build and run project
59+
build and run the project
6060

6161
```bash
6262
dotnet run
6363
```
6464

65-
in the console you should see printed inventory from the server.
65+
in the console, you should see printed inventory from the server.
6666

6767
### Intellisense
6868

docs/SwaggerClientProvider.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
<Note type="warning">
44

5-
The SwaggerClientProvider is outdated. There is no plans to improve custom Swagger 2.0 schema parser or bring new features to this type provider. We hope to remove it from source code when users migrate to [OpenApiClientProvider](/OpenApiClientProvider) and OpenApi 3.0 schemas.
5+
The SwaggerClientProvider is outdated. There are no plans to improve the custom Swagger 2.0 schema parser or bring new features to this type provider. We hope to remove it from the source code when users migrate to [OpenApiClientProvider](/OpenApiClientProvider) and OpenApi 3.0 schemas.
66

77
</Note>
88

9-
SwaggerClientProvider is generative F# Type Provider, build on top of custom Swagger schema parser that supports **only** 2.0 schema format.
9+
SwaggerClientProvider is a generative F# Type Provider, built on top of a custom Swagger schema parser that supports **only** 2.0 schema format.
1010

1111
```fsharp
1212
open SwaggerProvider
@@ -18,12 +18,12 @@ let petStore = PetStore.Client()
1818

1919
## Parameters
2020

21-
When you use TP you can specify following parameters
21+
When you use TP you can specify the following parameters
2222

2323
| Parameter | Description |
2424
|-----------|-------------|
2525
| `Schema` | Url or Path to Swagger schema file. |
26-
| `Headers` | HTTP Headers requiried to access the schema. |
26+
| `Headers` | HTTP Headers required to access the schema. |
2727
| `IgnoreOperationId` | Do not use `operationsId` and generate method names using `path` only. Default value `false`. |
2828
| `IgnoreControllerPrefix` | Do not parse `operationsId` as `<controllerName>_<methodName>` and generate one client class for all operations. Default value `true`. |
2929
| `PreferNullable` | Provide `Nullable<_>` for not required properties, instead of `Option<_>`. Defaults value `false`. |
@@ -47,7 +47,7 @@ let main argv =
4747
// Type Provider creates HttpClient for you under the hood
4848
let client = PetStore.Client()
4949
async {
50-
// Create new instance of provided type and add to store
50+
// Create a new instance of the provided type and add it to the store
5151
let pet = PetStore.Pet(Id = Some(24L), Name = "Shani")
5252
do! client.AddPet(pet)
5353

0 commit comments

Comments
 (0)