Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Kiota to generate OpenAPI clients #1479

Merged
merged 17 commits into from
Mar 2, 2024
Merged

Conversation

bkoelman
Copy link
Member

@bkoelman bkoelman commented Feb 25, 2024

This PR adds a support library, tests, examples and documentation for using JsonApiDotNetCore with Kiota, which is a fairly new OpenAPI client generator that supports the following languages: C#, Go, Java, PHP, Python, Ruby, Swift and TypeScript.

Because the project is still young, it has some rough edges and bugs, for which we provide workarounds where feasible:

In preparation, this PR contains various refactorings. See the individual commit messages for details.

Changes that affect usage:

  • Renamed package JsonApiDotNetCore.OpenApi.Client to JsonApiDotNetCore.OpenApi.Client.NSwag.
  • New package JsonApiDotNetCore.OpenApi.Client.Kiota.
  • The IMvcCoreBuilder mvcBuilder parameter has been removed from AddOpenApi().

Changes that affect internal development:

  • Renamed projects/namespaces to distinguish between NSwag and Kiota.
  • When running end-to-end tests, the incoming and outgoing HTTP traffic is logged to the test output window.
  • NSwag-generated client code is now under source control, so we'll know when something changes.
    Reverted that, due to https://youtrack.jetbrains.com/issue/RSRP-496113/Newtonsoft.Json-conflict-in-CleanupCode.
  • The generated swagger.g.json files in tests now live in the server test project; client tests point to it.

Closes #1458.

QUALITY CHECKLIST

@bkoelman bkoelman force-pushed the openapi-client-kiota branch 5 times, most recently from 94440a6 to 770d847 Compare February 25, 2024 16:11
Copy link

codecov bot commented Feb 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.76%. Comparing base (54c401c) to head (fccd8dd).

Additional details and impacted files
@@           Coverage Diff            @@
##           openapi    #1479   +/-   ##
========================================
  Coverage    90.75%   90.76%           
========================================
  Files          390      391    +1     
  Lines        12883    12896   +13     
  Branches      2044     2046    +2     
========================================
+ Hits         11692    11705   +13     
  Misses         776      776           
  Partials       415      415           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bkoelman bkoelman force-pushed the openapi-client-kiota branch 2 times, most recently from 89d4914 to 0509424 Compare February 26, 2024 01:22
@bkoelman bkoelman marked this pull request as ready for review February 26, 2024 02:38
@bkoelman
Copy link
Member Author

@verdie-g Would you like to review this PR?

@verdie-g
Copy link
Contributor

I can have a look if there is no hurry to merge it.

@bkoelman
Copy link
Member Author

I can have a look if there is no hurry to merge it.

There's no urgency. Also, the changes are relevant to be aware of for future development. Probably easiest to review per commit.

@bkoelman bkoelman merged commit 66cf92f into openapi Mar 2, 2024
16 checks passed
@bkoelman bkoelman deleted the openapi-client-kiota branch March 2, 2024 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants