8d896ade83
Bumps the kiota-dependencies group in /petstore/java with 7 updates: | Package | From | To | | --- | --- | --- | | [com.microsoft.kiota:microsoft-kiota-abstractions](https://github.com/microsoft/kiota-java) | `1.3.0` | `1.4.0` | | [com.microsoft.kiota:microsoft-kiota-authentication-azure](https://github.com/microsoft/kiota-java) | `1.3.0` | `1.4.0` | | [com.microsoft.kiota:microsoft-kiota-http-okHttp](https://github.com/microsoft/kiota-java) | `1.3.0` | `1.4.0` | | [com.microsoft.kiota:microsoft-kiota-serialization-json](https://github.com/microsoft/kiota-java) | `1.3.0` | `1.4.0` | | [com.microsoft.kiota:microsoft-kiota-serialization-text](https://github.com/microsoft/kiota-java) | `1.3.0` | `1.4.0` | | [com.microsoft.kiota:microsoft-kiota-serialization-form](https://github.com/microsoft/kiota-java) | `1.3.0` | `1.4.0` | | [com.microsoft.kiota:microsoft-kiota-serialization-multipart](https://github.com/microsoft/kiota-java) | `1.3.0` | `1.4.0` | Updates `com.microsoft.kiota:microsoft-kiota-abstractions` from 1.3.0 to 1.4.0 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.3.0...v1.4.0) Updates `com.microsoft.kiota:microsoft-kiota-authentication-azure` from 1.3.0 to 1.4.0 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.3.0...v1.4.0) Updates `com.microsoft.kiota:microsoft-kiota-http-okHttp` from 1.3.0 to 1.4.0 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.3.0...v1.4.0) Updates `com.microsoft.kiota:microsoft-kiota-serialization-json` from 1.3.0 to 1.4.0 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.3.0...v1.4.0) Updates `com.microsoft.kiota:microsoft-kiota-serialization-text` from 1.3.0 to 1.4.0 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.3.0...v1.4.0) Updates `com.microsoft.kiota:microsoft-kiota-serialization-form` from 1.3.0 to 1.4.0 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.3.0...v1.4.0) Updates `com.microsoft.kiota:microsoft-kiota-serialization-multipart` from 1.3.0 to 1.4.0 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.3.0...v1.4.0) --- updated-dependencies: - dependency-name: com.microsoft.kiota:microsoft-kiota-abstractions dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: com.microsoft.kiota:microsoft-kiota-authentication-azure dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: com.microsoft.kiota:microsoft-kiota-http-okHttp dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: com.microsoft.kiota:microsoft-kiota-serialization-json dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: com.microsoft.kiota:microsoft-kiota-serialization-text dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: com.microsoft.kiota:microsoft-kiota-serialization-form dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: com.microsoft.kiota:microsoft-kiota-serialization-multipart dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> |
||
---|---|---|
.. | ||
dotnet | ||
go | ||
java | ||
typescript | ||
README.md |
README.md
Swagger Petstore samples
The following section showcases client SDK generated using the OpenApi 'Swagger Petstore' using Kiota.
NOTE: Kiota version 1.0.1 was used to generate these SDK's.
Table of content
Language | Command line |
---|---|
dotnet | kiota generate --openapi https://petstore.swagger.io/v2/swagger.json --additional-data false --language csharp -o PetstoreClient -c PetstoreApiClient --log-level information --clean-output true --namespace-name KiotaSamples.PetStoreSdk |
java | kiota generate --openapi https://petstore.swagger.io/v2/swagger.json --language java -o utilities/src/main/java/petstore/utilities -n petstore.utilities |
typescript | kiota generate --openapi https://petstore.swagger.io/v2/swagger.json --language typescript -o src -n petstore.utilities |
go |
Example of data retrieved
This is a dotnet example that shows how the data looks, after generation AND the target api is called:
How to generate an SDK against the Swagger Petstore
These steps are all based on the official docs for generating dotnet Kiota SDK's:
- Create a new project or solution.
e.g.dotnet new console -o petstore cd petstore
- Add the nuget dependencies, which we will need for the SDK generated code to work:
e.g.dotnet add package Microsoft.Kiota.Abstractions dotnet add package Microsoft.Kiota.Http.HttpClientLibrary dotnet add package Microsoft.Kiota.Serialization.Json dotnet add package Microsoft.Kiota.Serialization.Text dotnet add package Microsoft.Kiota.Serialization.Form
- Create the Petstore SDK using Kiota and the custom params:
e.g.kiota generate \ --openapi https://petstore.swagger.io/v2/swagger.json \ --additional-data false \ --language csharp \ --output src\PetstoreClient \ --class-name PetstoreApiClient \ --log-level information \ --clean-output true \ --namespace-name KiotaSamples.PetStoreSdk
- And that's it! you're ready to go! So, lets grab some pets:
var pet = await client.Pet["69"].GetAsync();
-- end of readme --