Skip to content

Commit 914d9f9

Browse files
Apply suggestions from code review
Co-authored-by: Martin Costello <[email protected]>
1 parent 31e3e73 commit 914d9f9

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

docs/upgrade-guide-2.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ In the OpenAPI specification, there are a few properties that are defined as typ
7171

7272
In the v1 library, there are a set of classes that are derived from the `OpenApiAny` base class which is an abstract model which reflects the JSON data model plus some additional primitive types such as `decimal`, `float`, `datetime` etc.
7373

74-
In v2 we are removing this abstraction and relying on the JsonNode model to represent these inner types. In v1 we were not able to reliably identify the additional primitive types and it caused a significant amount of false negatives in error reporting as well as incorrectly parsed data values.
74+
In v2 we are removing this abstraction and relying on the `JsonNode` model to represent these inner types. In v1 we were not able to reliably identify the additional primitive types and it caused a significant amount of false negatives in error reporting as well as incorrectly parsed data values.
7575

76-
Due to JsonNode implicit operators, this makes initialization sometimes easier, instead of:
76+
Due to `JsonNode` implicit operators, this makes initialization sometimes easier, instead of:
7777
```csharp
7878
new OpenApiParameter
7979
{
@@ -85,7 +85,7 @@ Due to JsonNode implicit operators, this makes initialization sometimes easier,
8585
```
8686
the assignment becomes simply,
8787
```csharp
88-
Example = (float)0.5,
88+
Example = 0.5f,
8989
```
9090

9191
For a more complex example, where the developer wants to create an extension that is an object they would do this in v1:
@@ -153,7 +153,6 @@ The OpenAPI 3.1 specification changes significantly how it leverages JSON Schema
153153
public IDictionary<string, OpenApiSchema> Definitions { get; set; }
154154
public IDictionary<string, OpenApiSchema> PatternProperties { get; set; } = new Dictionary<string, OpenApiSchema>();
155155
public bool UnevaluatedProperties { get; set;}
156-
public bool UnEvaluatedProperties { get; set; } // Duplicate should be removed
157156

158157
```
159158
#### Changes to existing keywords
@@ -174,7 +173,7 @@ The OpenAPI 3.1 specification changes significantly how it leverages JSON Schema
174173
175174
public virtual JsonNode Example { get; set; } // No longer IOpenApiAny
176175
public virtual IList<JsonNode> Examples { get; set; }
177-
public virtual IList<JsonNode> Enum { get; set; } = new List<JsonNode>();
176+
public virtual IList<JsonNode> Enum { get; set; }
178177
public virtual OpenApiExternalDocs ExternalDocs { get; set; } // OpenApi Vocab
179178
public virtual bool Deprecated { get; set; } // OpenApi Vocab
180179
public virtual OpenApiXml Xml { get; set; } // OpenApi Vocab
@@ -184,7 +183,7 @@ The OpenAPI 3.1 specification changes significantly how it leverages JSON Schema
184183

185184
#### OpenApiSchema methods
186185

187-
Other than the addition of the SerializeAsV31, the methods have not changed.
186+
Other than the addition of `SerializeAsV31`, the methods have not changed.
188187

189188
```csharp
190189
public class OpenApiSchema : IOpenApiAnnotatable, IOpenApiExtensible, IOpenApiReferenceable, IOpenApiSerializable
@@ -200,7 +199,7 @@ public class OpenApiSchema : IOpenApiAnnotatable, IOpenApiExtensible, IOpenApiRe
200199

201200
## OpenAPI v3.1 Support
202201

203-
There are a number of new features in OpenAPI v3.1 that are now supported in OpenAPI.Net.
202+
There are a number of new features in OpenAPI v3.1 that are now supported in OpenAPI.NET.
204203

205204
### Webhooks
206205

@@ -213,7 +212,6 @@ public class OpenApiDocument : IOpenApiSerializable, IOpenApiExtensible, IOpenA
213212
/// The key name is a unique string to refer to each webhook, while the (optionally referenced) Path Item Object describes a request that may be initiated by the API provider and the expected responses
214213
/// </summary>
215214
public IDictionary<string, OpenApiPathItem>? Webhooks { get; set; } = new Dictionary<string, OpenApiPathItem>();
216-
217215
}
218216
```
219217

0 commit comments

Comments
 (0)