Skip to content

Commit 14a44cd

Browse files
authored
Document OpenAPI limitations (#1715)
1 parent cccb011 commit 14a44cd

File tree

3 files changed

+43
-3
lines changed

3 files changed

+43
-3
lines changed

Diff for: docs/usage/openapi-client.md

+37
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
> [!WARNING]
2+
> OpenAPI support for JSON:API is currently experimental. The API and the structure of the OpenAPI document may change in future versions.
3+
14
# OpenAPI clients
25

36
After [enabling OpenAPI](~/usage/openapi.md), you can generate a typed JSON:API client for your API in various programming languages.
@@ -317,3 +320,37 @@ demonstrates how to use them. It uses local IDs to:
317320
- Assign the todo-item to the created person
318321

319322
---
323+
324+
## Known limitations
325+
326+
# [NSwag](#tab/nswag)
327+
328+
| Limitation | Workaround | Links |
329+
| --- | --- | --- |
330+
| Partial POST/PATCH sends incorrect request | Use `TrackChangesFor` from `JsonApiDotNetCore.OpenApi.Client.NSwag` package | |
331+
| Exception thrown on successful HTTP status | Use `TranslateAsync` from `JsonApiDotNetCore.OpenApi.Client.NSwag` package | https://github.com/RicoSuter/NSwag/issues/2499 |
332+
| No `Accept` header sent when only error responses define `Content-Type` | `JsonApiDotNetCore.OpenApi.Swashbuckle` package contains workaround | |
333+
| Schema type not always inferred with `allOf` | `JsonApiDotNetCore.OpenApi.Swashbuckle` package contains workaround | |
334+
| Generated code for JSON:API extensions does not compile | `JsonApiDotNetCore.OpenApi.Swashbuckle` package contains workaround | |
335+
| A project can't contain both JSON:API clients and regular OpenAPI clients | Use separate projects | |
336+
337+
# [Kiota](#tab/kiota)
338+
339+
| Limitation | Workaround | Links |
340+
| --- | --- | --- |
341+
| Properties are always nullable | - | https://github.com/microsoft/kiota/issues/3911 |
342+
| JSON:API query strings are inaccessible | Use `SetQueryStringHttpMessageHandler.CreateScope` from `JsonApiDotNetCore.OpenApi.Client.Kiota` package | https://github.com/microsoft/kiota/issues/3800 |
343+
| Properties set to `null` are sent twice | - | https://github.com/microsoft/kiota-dotnet/issues/535 |
344+
| HTTP 304 (Not Modified) is not properly recognized | Catch `ApiException` and inspect the response status code | https://github.com/microsoft/kiota/issues/4190, https://github.com/microsoft/kiota-dotnet/issues/531 |
345+
| Generator warns about unsupported formats | Use `JsonApiDotNetCore.OpenApi.Client.Kiota` package | https://github.com/microsoft/kiota/issues/4227 |
346+
| `Stream` response for HEAD request | - | https://github.com/microsoft/kiota/issues/4245 |
347+
| Unhelpful exception messages | - | https://github.com/microsoft/kiota/issues/4349 |
348+
| Discriminator properties aren't being set automatically | - | https://github.com/microsoft/kiota/issues/4618 |
349+
| Discriminator mappings must be repeated in every derived type used in responses | `JsonApiDotNetCore.OpenApi.Swashbuckle` package contains workaround | https://github.com/microsoft/kiota/issues/2432 |
350+
| `x-abstract` in `openapi.json` is ignored | - | |
351+
| No MSBuild / IDE support | Use `KiotaReference` from `JsonApiDotNetCore.OpenApi.Client.Kiota` package | https://github.com/microsoft/kiota/issues/3005 |
352+
| Incorrect nullability in API methods | Use `KiotaReference` from `JsonApiDotNetCore.OpenApi.Client.Kiota` package | https://github.com/microsoft/kiota/issues/3944 |
353+
| Generated code for JSON:API extensions does not compile | `JsonApiDotNetCore.OpenApi.Swashbuckle` package contains workaround | |
354+
| Properties are always sent in alphabetic order | - | https://github.com/microsoft/kiota/issues/4680 |
355+
356+
---

Diff for: docs/usage/openapi-documentation.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
> [!WARNING]
2+
> OpenAPI support for JSON:API is currently experimental. The API and the structure of the OpenAPI document may change in future versions.
3+
14
# OpenAPI documentation
25

36
After [enabling OpenAPI](~/usage/openapi.md), you can expose a documentation website with SwaggerUI, Redoc and/or Scalar.

Diff for: docs/usage/openapi.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
> [!WARNING]
2+
> OpenAPI support for JSON:API is currently experimental. The API and the structure of the OpenAPI document may change in future versions.
3+
14
# OpenAPI
25

36
Exposing an [OpenAPI document](https://swagger.io/specification/) for your JSON:API endpoints enables to provide a
@@ -7,9 +10,6 @@ Exposing an [OpenAPI document](https://swagger.io/specification/) for your JSON:
710
The [JsonApiDotNetCore.OpenApi.Swashbuckle](https://github.com/json-api-dotnet/JsonApiDotNetCore/pkgs/nuget/JsonApiDotNetCore.OpenApi.Swashbuckle) NuGet package
811
provides OpenAPI support for JSON:API by integrating with [Swashbuckle](https://github.com/domaindrivendev/Swashbuckle.AspNetCore).
912

10-
> [!WARNING]
11-
> OpenAPI support for JSON:API is currently experimental. The API and the structure of the OpenAPI document may change in future versions.
12-
1313
## Getting started
1414

1515
1. Install the `JsonApiDotNetCore.OpenApi.Swashbuckle` NuGet package:

0 commit comments

Comments
 (0)