forked from loafle/openapi-generator-original
* [CsharpNetStandard] Added C# .NET Standard Client Generation Added language CsharpNetStandard. Everything copied from csharp Client Generator. Dependancies switched from Restsharp to Restsharp.Portable. Changes made where nececary to replicate Restsharp functionallity. Project type changed to .NET Standard protable library. * [CsharpNetStandard] Removed client prop validation due to incompability * [CsharpNetStandard] Minor fixes Changed leftover RestSharp.Method to Method Changed to .Net Standard 1.3 for compability reasons Changed excludeTests to default to true due to tests not being implemented yet Removed unnecessary targetFramework property Removed leftover UWP stuff * [CsharpNetStandard] More fixes Added correct dependencies to Readme Added correct supported frameworks to Readme Added slightly better placeholder for installation instructions in Readme Removed leftover dependencies from project.json Removed leftover SupportsAsync stuff Removed references to build.bat/-.sh since they're not yet being generated Todo implement test generation * [CsharpNetStandard] Added forgoten git_push.sh * [C#-netstandard] Renamed option to csharp-netstandard Also added .bat file for test generation * [C# Net Standard] fixed path in .bat file * [C# NET Standard] fixes to enum generation Fixed issues with enum generation due to tired programmer * [C# NET Standard] Generated sample client library Sample library generated Fixes: Class actually works again .bat - minor inconsistency fixed * [C# NET Standard] Error corrected in how timeout is set Configuration Timeout property changed to TimeSpan type and code corrected around that * [C#] Merged .NET Standard generator into csharp generator Functionallity of csharp-netstarndard generator has been moved into standard csharp generator under the targetFramework option as "v5.0"
IO.Swagger - the C# library for the Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: " \
This C# SDK is automatically generated by the Swagger Codegen project:
- API version: 1.0.0
- SDK version: 1.0.0
- Build package: io.swagger.codegen.languages.CSharpClientCodegen
Frameworks supported
- .NET Core >=1.0
- .NET Framework >=4.6
- Mono/Xamarin >=vNext
- UWP >=10.0
Dependencies
- FubarCoder.RestSharp.Portable.Core >=4.0.7
- FubarCoder.RestSharp.Portable.HttpClient >=4.0.7
- Newtonsoft.Json >=9.0.1
Installation
Generate the DLL using your preferred tool
Then include the DLL (under the bin
folder) in the C# project, and use the namespaces:
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
Getting Started
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class Example
{
public void main()
{
var apiInstance = new FakeApi();
var body = new ModelClient(); // ModelClient | client model
try
{
// To test \"client\" model
ModelClient result = apiInstance.TestClientModel(body);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message );
}
}
}
}
Documentation for API Endpoints
All URIs are relative to http://petstore.swagger.io/v2
Class | Method | HTTP request | Description |
---|---|---|---|
FakeApi | TestClientModel | PATCH /fake | To test "client" model |
FakeApi | TestEndpointParameters | POST /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 |
FakeApi | TestEnumParameters | GET /fake | To test enum parameters |
PetApi | AddPet | POST /pet | Add a new pet to the store |
PetApi | DeletePet | DELETE /pet/{petId} | Deletes a pet |
PetApi | FindPetsByStatus | GET /pet/findByStatus | Finds Pets by status |
PetApi | FindPetsByTags | GET /pet/findByTags | Finds Pets by tags |
PetApi | GetPetById | GET /pet/{petId} | Find pet by ID |
PetApi | UpdatePet | PUT /pet | Update an existing pet |
PetApi | UpdatePetWithForm | POST /pet/{petId} | Updates a pet in the store with form data |
PetApi | UploadFile | POST /pet/{petId}/uploadImage | uploads an image |
StoreApi | DeleteOrder | DELETE /store/order/{orderId} | Delete purchase order by ID |
StoreApi | GetInventory | GET /store/inventory | Returns pet inventories by status |
StoreApi | GetOrderById | GET /store/order/{orderId} | Find purchase order by ID |
StoreApi | PlaceOrder | POST /store/order | Place an order for a pet |
UserApi | CreateUser | POST /user | Create user |
UserApi | CreateUsersWithArrayInput | POST /user/createWithArray | Creates list of users with given input array |
UserApi | CreateUsersWithListInput | POST /user/createWithList | Creates list of users with given input array |
UserApi | DeleteUser | DELETE /user/{username} | Delete user |
UserApi | GetUserByName | GET /user/{username} | Get user by user name |
UserApi | LoginUser | GET /user/login | Logs user into the system |
UserApi | LogoutUser | GET /user/logout | Logs out current logged in user session |
UserApi | UpdateUser | PUT /user/{username} | Updated user |
Documentation for Models
- Model.AdditionalPropertiesClass
- Model.Animal
- Model.AnimalFarm
- Model.ApiResponse
- Model.ArrayOfArrayOfNumberOnly
- Model.ArrayOfNumberOnly
- Model.ArrayTest
- Model.Capitalization
- Model.Cat
- Model.Category
- Model.ClassModel
- Model.Dog
- Model.EnumArrays
- Model.EnumClass
- Model.EnumTest
- Model.FormatTest
- Model.HasOnlyReadOnly
- Model.List
- Model.MapTest
- Model.MixedPropertiesAndAdditionalPropertiesClass
- Model.Model200Response
- Model.ModelClient
- Model.ModelReturn
- Model.Name
- Model.NumberOnly
- Model.Order
- Model.OuterEnum
- Model.Pet
- Model.ReadOnlyFirst
- Model.SpecialModelName
- Model.Tag
- Model.User
Documentation for Authorization
api_key
- Type: API key
- API key parameter name: api_key
- Location: HTTP header
http_basic_test
- Type: HTTP basic authentication
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