openapi-generator/samples/client/petstore-security-test/csharp/SwaggerClient
2017-05-10 15:24:43 +08:00
..
docs fix double hyphen in c# generator 2016-07-13 18:16:52 +08:00
src [csharp] fixes for netstandard (json serializing and project files) (#5590) 2017-05-10 15:24:43 +08:00
.gitignore [C#] Fix guid for C# security samples (#5283) 2017-04-04 14:38:47 +08:00
.swagger-codegen-ignore better code injection handling for c# 2016-06-29 22:52:12 +08:00
.travis.yml [C#] Fix guid for C# security samples (#5283) 2017-04-04 14:38:47 +08:00
build.bat [C#] Fix guid for C# security samples (#5283) 2017-04-04 14:38:47 +08:00
build.sh [C#] Fix guid for C# security samples (#5283) 2017-04-04 14:38:47 +08:00
git_push.sh better code injection handling for c# 2016-06-29 22:52:12 +08:00
IO.Swagger.sln fix double hyphen in c# generator 2016-07-13 18:16:52 +08:00
IO.Swagger.userprefs fix csharp enum naming 2016-07-13 19:11:22 +08:00
LICENSE better code injection handling for c# 2016-06-29 22:52:12 +08:00
mono_nunit_test.sh [C#] Fix guid for C# security samples (#5283) 2017-04-04 14:38:47 +08:00
README.md [C#] Fix guid for C# security samples (#5283) 2017-04-04 14:38:47 +08:00

IO.Swagger - the C# library for the Swagger Petstore *_/ ' " =end - - \r\n \n \r

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: " \ *_/ ' " =end - -

This C# SDK is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0 *_/ ' " =end - - \r\n \n \r
  • SDK version: 1.0.0
  • Build package: io.swagger.codegen.languages.CSharpClientCodegen

Frameworks supported

  • .NET 4.0 or later
  • Windows Phone 7.1 (Mango)

Dependencies

The DLLs included in the package may not be the latest version. We recommend using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742

Installation

Run the following command to generate the DLL

  • [Mac/Linux] /bin/sh build.sh
  • [Windows] build.bat

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;

Packaging

A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.

This .nuspec uses placeholders from the .csproj, so build the .csproj directly:

nuget pack -Build -OutputDirectory out IO.Swagger.csproj

Then, publish to a local feed or other host and consume the new package via Nuget as usual.

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 testCodeInjectEndRnNR = testCodeInjectEndRnNR_example;  // string | To test code injection *_/ ' \" =end - - \\r\\n \\n \\r (optional) 

            try
            {
                // To test code injection *_/ ' \" =end - - \\r\\n \\n \\r
                apiInstance.TestCodeInjectEndRnNR(testCodeInjectEndRnNR);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FakeApi.TestCodeInjectEndRnNR: " + e.Message );
            }
        }
    }
}

Documentation for API Endpoints

All URIs are relative to *https://petstore.swagger.io / ' " =end - - \r\n \n \r/v2 */ ' " =end - - \r\n \n \r

Class Method HTTP request Description
FakeApi TestCodeInjectEndRnNR PUT /fake To test code injection *_/ ' " =end - - \r\n \n \r

Documentation for Models

Documentation for Authorization

api_key

  • Type: API key
  • API key parameter name: api_key */ ' " =end -- \r\n \n \r
  • Location: HTTP header

petstore_auth

  • Type: OAuth
  • Flow: implicit
  • Authorization URL: http://petstore.swagger.io/api/oauth/dialog
  • Scopes:
    • write:pets: modify pets in your account *_/ ' " =end - - \r\n \n \r
    • read:pets: read your pets *_/ ' " =end - - \r\n \n \r