-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[C#] Fix issue #1088 with generation of enum classes referenced from …
…other objects (#1089) * Run ./bin/utils/ensure-up-to-date to re-generate samples run in the CI. * Fixed the #1088 issue by removing the update of enumeration properties while processing objects that reference them. Launched the ./bin/csharp-petstore-all.sh script.
- Loading branch information
1 parent
6acf45a
commit 529a638
Showing
124 changed files
with
7,987 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...ent/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.openapi-generator-ignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# OpenAPI Generator Ignore | ||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||
|
||
# Use this file to prevent files from being overwritten by the generator. | ||
# The patterns follow closely to .gitignore or .dockerignore. | ||
|
||
# As an example, the C# client generator defines ApiClient.cs. | ||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: | ||
#ApiClient.cs | ||
|
||
# You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||
#foo/*/qux | ||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||
|
||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||
#foo/**/qux | ||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||
|
||
# You can also negate patterns with an exclamation (!). | ||
# For example, you can ignore all files in a docs folder with the file extension .md: | ||
#docs/*.md | ||
# Then explicitly reverse the ignore rule for a single file: | ||
#!docs/README.md |
1 change: 1 addition & 0 deletions
1
...nt/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.openapi-generator/VERSION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.3.0-SNAPSHOT |
131 changes: 131 additions & 0 deletions
131
...es/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
# Org.OpenAPITools - the C# library for the OpenAPI Petstore | ||
|
||
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. | ||
|
||
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: | ||
|
||
- API version: 1.0.0 | ||
- SDK version: 1.0.0 | ||
- Build package: org.openapitools.codegen.languages.CSharpDotNet2ClientCodegen | ||
|
||
<a name="frameworks-supported"></a> | ||
## Frameworks supported | ||
- .NET 2.0 | ||
|
||
<a name="dependencies"></a> | ||
## Dependencies | ||
- Mono compiler | ||
- Newtonsoft.Json.7.0.1 | ||
- RestSharp.Net2.1.1.11 | ||
|
||
Note: NuGet is downloaded by the mono compilation script and packages are installed with it. No dependency DLLs are bundled with this generator | ||
|
||
<a name="installation"></a> | ||
## Installation | ||
Run the following command to generate the DLL | ||
- [Mac/Linux] `/bin/sh compile-mono.sh` | ||
- [Windows] TODO | ||
|
||
Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: | ||
```csharp | ||
using Org.OpenAPITools.Api; | ||
using Org.OpenAPITools.Client; | ||
using Org.OpenAPITools.Model; | ||
``` | ||
<a name="getting-started"></a> | ||
## Getting Started | ||
|
||
```csharp | ||
using System; | ||
using System.Diagnostics; | ||
using Org.OpenAPITools.Api; | ||
using Org.OpenAPITools.Client; | ||
using Org.OpenAPITools.Model; | ||
|
||
namespace Example | ||
{ | ||
public class Example | ||
{ | ||
public void main() | ||
{ | ||
|
||
// Configure OAuth2 access token for authorization: petstore_auth | ||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; | ||
|
||
var apiInstance = new PetApi(); | ||
var pet = new Pet(); // Pet | Pet object that needs to be added to the store | ||
try | ||
{ | ||
// Add a new pet to the store | ||
apiInstance.AddPet(pet); | ||
} | ||
catch (Exception e) | ||
{ | ||
Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
<a name="documentation-for-api-endpoints"></a> | ||
## Documentation for API Endpoints | ||
|
||
All URIs are relative to *http://petstore.swagger.io/v2* | ||
|
||
Class | Method | HTTP request | Description | ||
------------ | ------------- | ------------- | ------------- | ||
*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store | ||
*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet | ||
*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status | ||
*PetApi* | [**FindPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags | ||
*PetApi* | [**GetPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID | ||
*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet | ||
*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data | ||
*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image | ||
*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID | ||
*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status | ||
*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID | ||
*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet | ||
*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user | ||
*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array | ||
*UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array | ||
*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user | ||
*UserApi* | [**GetUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name | ||
*UserApi* | [**LoginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system | ||
*UserApi* | [**LogoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session | ||
*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user | ||
|
||
|
||
<a name="documentation-for-models"></a> | ||
## Documentation for Models | ||
|
||
- [Org.OpenAPITools.Model.ApiResponse](docs/ApiResponse.md) | ||
- [Org.OpenAPITools.Model.Category](docs/Category.md) | ||
- [Org.OpenAPITools.Model.Order](docs/Order.md) | ||
- [Org.OpenAPITools.Model.Pet](docs/Pet.md) | ||
- [Org.OpenAPITools.Model.Tag](docs/Tag.md) | ||
- [Org.OpenAPITools.Model.User](docs/User.md) | ||
|
||
|
||
<a name="documentation-for-authorization"></a> | ||
## Documentation for Authorization | ||
|
||
<a name="api_key"></a> | ||
### api_key | ||
|
||
- **Type**: API key | ||
- **API key parameter name**: api_key | ||
- **Location**: HTTP header | ||
|
||
<a name="petstore_auth"></a> | ||
### petstore_auth | ||
|
||
- **Type**: OAuth | ||
- **Flow**: implicit | ||
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog | ||
- **Scopes**: | ||
- write:pets: modify pets in your account | ||
- read:pets: read your pets | ||
|
12 changes: 12 additions & 0 deletions
12
samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/compile-mono.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe; | ||
mozroots --import --sync | ||
mono nuget.exe install vendor/packages.config -o vendor; | ||
mkdir -p bin; | ||
mcs -sdk:2 -r:vendor/Newtonsoft.Json.7.0.1/lib/net20/Newtonsoft.Json.dll,\ | ||
vendor/RestSharp.Net2.1.1.11/lib/net20/RestSharp.Net2.dll,\ | ||
System.Runtime.Serialization.dll \ | ||
-target:library \ | ||
-out:bin/Org.OpenAPITools.dll \ | ||
-recurse:'src/*.cs' \ | ||
-doc:bin/Org.OpenAPITools.xml \ | ||
-platform:anycpu |
11 changes: 11 additions & 0 deletions
11
...petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/ApiResponse.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Org.OpenAPITools.Model.ApiResponse | ||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**Code** | **int?** | | [optional] | ||
**Type** | **string** | | [optional] | ||
**Message** | **string** | | [optional] | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
10 changes: 10 additions & 0 deletions
10
...nt/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Category.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Org.OpenAPITools.Model.Category | ||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**Id** | **long?** | | [optional] | ||
**Name** | **string** | | [optional] | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
14 changes: 14 additions & 0 deletions
14
...lient/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Order.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Org.OpenAPITools.Model.Order | ||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**Id** | **long?** | | [optional] | ||
**PetId** | **long?** | | [optional] | ||
**Quantity** | **int?** | | [optional] | ||
**ShipDate** | **DateTime?** | | [optional] | ||
**Status** | **string** | Order Status | [optional] | ||
**Complete** | **bool?** | | [optional] [default to false] | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
14 changes: 14 additions & 0 deletions
14
.../client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Pet.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Org.OpenAPITools.Model.Pet | ||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**Id** | **long?** | | [optional] | ||
**Category** | [**Category**](Category.md) | | [optional] | ||
**Name** | **string** | | | ||
**PhotoUrls** | **List<string>** | | | ||
**Tags** | [**List<Tag>**](Tag.md) | | [optional] | ||
**Status** | **string** | pet status in the store | [optional] | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
Oops, something went wrong.