Skip to content

Commit b15be9b

Browse files
authored
Merge pull request #8903 from swagger-api/generator-issue-199
Generator issue 199
2 parents 8ff5409 + 8071b2f commit b15be9b

File tree

620 files changed

+78220
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

620 files changed

+78220
-6
lines changed

bin/aspnetcore-petstore-server.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ fi
2828
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -Dlogback.configurationFile=bin/logback.xml"
2929
ags="$@ generate -l aspnetcore -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -o samples/server/petstore/aspnetcore --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5}"
3030

31-
# java $JAVA_OPTS -jar $executable $ags
31+
java $JAVA_OPTS -jar $executable $ags

bin/csharp-dotnet2-petstore.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ fi
2828
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -Dlogback.configurationFile=bin/logback.xml"
2929
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l csharp-dotnet2 -o samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient --additional-properties hideGenerationTimestamp=true"
3030

31-
# java $JAVA_OPTS -jar $executable $ags
31+
java $JAVA_OPTS -jar $executable $ags

bin/csharp-petstore-net-35.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ fi
2828
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -Dlogback.configurationFile=bin/logback.xml"
2929
ags="generate $@ -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l csharp -o samples/client/petstore/csharp/SwaggerClientNet35 --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} -c ./bin/csharp-petstore-net-35.json"
3030

31-
# java $JAVA_OPTS -jar $executable $ags
31+
java $JAVA_OPTS -jar $executable $ags

bin/csharp-petstore-net-40.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ fi
2828
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -Dlogback.configurationFile=bin/logback.xml"
2929
ags="generate $@ -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l csharp -o samples/client/petstore/csharp/SwaggerClientNet40 --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} -c ./bin/csharp-petstore-net-40.json"
3030

31-
# java $JAVA_OPTS -jar $executable $ags
31+
java $JAVA_OPTS -jar $executable $ags

bin/csharp-petstore-net-standard.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ fi
2828
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -Dlogback.configurationFile=bin/logback.xml"
2929
ags="generate $@ -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l csharp -o samples/client/petstore/csharp/SwaggerClientNetStandard --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} -c ./bin/csharp-petstore-net-standard.json"
3030

31-
# java $JAVA_OPTS -jar $executable $ags
31+
java $JAVA_OPTS -jar $executable $ags

bin/csharp-property-changed-petstore.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ fi
2828
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -Dlogback.configurationFile=bin/logback.xml"
2929
ags="generate $@ -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l csharp -o samples/client/petstore/csharp/SwaggerClientWithPropertyChanged --additional-properties generatePropertyChanged=true --additional-properties packageGuid={5CD900DE-8266-412F-A758-28E1F9C623D5}"
3030

31-
# java $JAVA_OPTS -jar $executable $ags
31+
java $JAVA_OPTS -jar $executable $ags

modules/swagger-codegen/src/main/java/io/swagger/codegen/v3/CodegenConstants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case,
215215
public static final String GENERATE_PROPERTY_CHANGED = "generatePropertyChanged";
216216
public static final String GENERATE_PROPERTY_CHANGED_DESC = "Specifies that models support raising property changed events.";
217217

218+
public static final String PRESERVE_COMMENT_NEWLINES = "preserveNewlinesInComments";
219+
218220
public static final String NON_PUBLIC_API = "nonPublicApi";
219221
public static final String NON_PUBLIC_API_DESC = "Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.";
220222

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Swagger Codegen Ignore
2+
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0.3-SNAPSHOT
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# IO.Swagger - the C# library for the Swagger Petstore
2+
3+
This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
4+
5+
This C# SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
6+
7+
- API version: 1.0.0
8+
- SDK version: 1.0.0
9+
- Build package: io.swagger.codegen.v3.generators.dotnet.CsharpDotNet2ClientCodegen
10+
11+
<a name="frameworks-supported"></a>
12+
## Frameworks supported
13+
- .NET 2.0
14+
15+
<a name="dependencies"></a>
16+
## Dependencies
17+
- Mono compiler
18+
- Newtonsoft.Json.7.0.1
19+
- RestSharp.Net2.1.1.11
20+
21+
Note: NuGet is downloaded by the mono compilation script and packages are installed with it. No dependency DLLs are bundled with this generator
22+
23+
<a name="installation"></a>
24+
## Installation
25+
Run the following command to generate the DLL
26+
- [Mac/Linux] `/bin/sh compile-mono.sh`
27+
- [Windows] TODO
28+
29+
Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces:
30+
```csharp
31+
using IO.Swagger.Api;
32+
using IO.Swagger.Client;
33+
using IO.Swagger.Model;
34+
```
35+
<a name="getting-started"></a>
36+
## Getting Started
37+
38+
```csharp
39+
using System;
40+
using System.Diagnostics;
41+
using IO.Swagger.Api;
42+
using IO.Swagger.Client;
43+
using IO.Swagger.Model;
44+
45+
namespace Example
46+
{
47+
public class Example
48+
{
49+
public void main()
50+
{
51+
52+
// Configure OAuth2 access token for authorization: petstore_auth
53+
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
54+
55+
var apiInstance = new PetApi();
56+
var body = new Pet(); // Pet | Pet object that needs to be added to the store
57+
58+
try
59+
{
60+
// Add a new pet to the store
61+
apiInstance.AddPet(body);
62+
}
63+
catch (Exception e)
64+
{
65+
Debug.Print("Exception when calling PetApi.AddPet: " + e.Message );
66+
}
67+
}
68+
}
69+
}
70+
```
71+
72+
<a name="documentation-for-api-endpoints"></a>
73+
## Documentation for API Endpoints
74+
75+
All URIs are relative to *http://petstore.swagger.io/v2*
76+
77+
Class | Method | HTTP request | Description
78+
------------ | ------------- | ------------- | -------------
79+
*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
80+
*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
81+
*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
82+
*PetApi* | [**FindPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
83+
*PetApi* | [**GetPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
84+
*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
85+
*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
86+
*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
87+
*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
88+
*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
89+
*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID
90+
*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
91+
*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user
92+
*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
93+
*UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
94+
*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
95+
*UserApi* | [**GetUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
96+
*UserApi* | [**LoginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system
97+
*UserApi* | [**LogoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
98+
*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
99+
100+
<a name="documentation-for-models"></a>
101+
## Documentation for Models
102+
103+
- [IO.Swagger.Model.ApiResponse](docs/ApiResponse.md)
104+
- [IO.Swagger.Model.Category](docs/Category.md)
105+
- [IO.Swagger.Model.Order](docs/Order.md)
106+
- [IO.Swagger.Model.Pet](docs/Pet.md)
107+
- [IO.Swagger.Model.Tag](docs/Tag.md)
108+
- [IO.Swagger.Model.User](docs/User.md)
109+
110+
<a name="documentation-for-authorization"></a>
111+
## Documentation for Authorization
112+
113+
<a name="api_key"></a>
114+
### api_key
115+
116+
- **Type**: API key
117+
- **API key parameter name**: api_key
118+
- **Location**: HTTP header
119+
120+
<a name="petstore_auth"></a>
121+
### petstore_auth
122+
123+
- **Type**: OAuth
124+
- **Flow**: implicit
125+
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
126+
- **Scopes**:
127+
- :
128+

0 commit comments

Comments
 (0)