Justin Black d4b8ff60a1
[Java] Fixes schema class type booleans for composed schemas (#10334)
* Adds get/setIsString interface to IJsonSchemaValidationProperties

* Adds get/set isNumber interface in IJsonSchemaValidationProperties

* Adds get/set isAnyType in IJsonSchemaValidationProperties

* Adds and uses ModelUtils.isAnyType, adds setTypeProperties

* Adds missing descriptions of isAnyType parameters

* Uses ModelUtils.isAnyType

* Samples regenerated

* Moves isArray handling higher up in fromProperty

* Moves isAnyTypeSchema handling higher up in fromProperty

* Moves isFreeFormObject handling higher up in fromProperty

* Refactors fromProperties, updates tests

* Fixes the fromProperty refactor, tests now pass

* Uses setTypeProperties to set isNumber, isNull, isArray, and isUnboundedInteger

* Sets isAnyType in setTypeProperties

* Sets isMap in setTypeProperties

* Sets property.isPrimitiveType in isFreeFormObject, tweaks if condition order

* Adds fix for JavaClientCodegenTest.testJdkHttpClientWithAndWithoutDiscriminator

* Refactors fromProperty

* Adds updatePropertyForObject updatePropertyForAnyType

* Sets binary and file types to not be strings

* Updates samples

* Adds updatePropertyForString

* Adds testComposedPropertyTypes

* Fixes python test

* Samples updated

* Switches all isAnyTypeSchema usages to ModelUtils.isAnyType

* Refactors model enum handling higher up

* Moves m.dataType assignent higher into fromModel

* Moves m.isNullable setting higher into isModel

* Adds updateModelForComposedSchema

* Further fromModel refactoring, all schema checks are now at the same indentation level

* Further refactors fromModel, adds isTypeObjectSchema block

* Moves addVars into anyType or objectType blocks in fromModel

* Turns off isNullable n isAnyType array

* Fixes typescript CodegenParameers

* Adds updatePropertyForAnyType to typescript-axios so property.isNullable will be false for AnyType

* Adds testComposedModelTypes

* Updates ComposedAnyType schema

* Fixes tests for JavaJAXRSCXF by adding updateModelForObject method

* Updates go and csharp to handle object model differently

* Adds updateModelForAnyType

* Fixes name reference

* Adds testComposedResponseTypes

* Refactoring fromResponse

* Further refactoring of fromResponse

* Uses setTypeProperties in fromResponse

* Tests now pass for testComposedResponseTypes

* Sets COdegenResponse dataType using getTypeDeclaration

* Begins refactoring of fromRequestBody

* Adds updateResponseBodyForPrimitiveType

* Adds all needed type if else blocks in fromRequestBody

* Fixes JavaJAXRSCXFExtServerCodegenTests

* Fixes RubyClientCodegenTests

* Adds fixes for clients that need custom isMap for body parameters

* Ruby broken, samples regened, debugging

* Adds updateRequestBodyForArray, renames updateRequest.. methods

* Samples regenerated

* Removes changes from Ruby generator

* Reverts RubyClientCodegen.java

* Reverts changes to GoClientCodegen.java

* Reverts PowerShellClientCodegen.java

* Reverts CrystalClientCodegen.java

* Removes updateRequestBodyForObject from JavaCXFServerCodegen.java

* Adds comment about refed models

* Tweaks made to fromProperties to add an explanatory comment

* Updates RustServer to have ByteArray request bodies not be strings

* Sets types in fromFormProperty

* Adds testComposedRequestBodyTypes

* Fixes when validation syncing is done in syncValidationProperties

* Removes redundant validation code from fromParameter

* Moves parameter inX setting higher up before schema logic in fromParameter

* More refactoring in fromParameter, uses early return to reduce levels of indentation

* Removes setParameterBooleanFlagWithCodegenProperty from updateRequestBodyForArray

* Removes setParameterBooleanFlagWithCodegenProperty from updateRequestBodyForObject

* Removes setParameterBooleanFlagWithCodegenProperty from  updateRequestBodyForPrimitiveType

* Removes setParameterBooleanFlagWithCodegenProperty from updateRequestBodyForMap

* Removes setParameterBooleanFlagWithCodegenProperty from addBodyModelSchema

* Removes setParameterBooleanFlagWithCodegenProperty from fromFormProperty

* Refactors parameter array handling code into fromFormProperty

* Simplifies fromRequestBodyToFormParameters

* Removes setParameterBooleanFlagWithCodegenProperty from fromParameter

* Adds deprecated docstring to setParameterBooleanFlagWithCodegenProperty

* Refactors ModelUtils.isFileSchema out of string schema check

* Removes ModelUtils.isFileSchema from RustServer updateRequestBodyForString

* Improves comment text

* Fixes RustServer uuid type setting for CodegenParameter

* Removes unneeded parens

* Fixes array property examples

* Removes unused code

* Renames variable to itemsProperty

* Adds testComposedRequestQueryParamTypes

* Adds updatePropertyForAnyType to rustserver will not have changed model properties

* Hoists arrayInnerProperty._enum into parameter for html2 generator

* Moves turning string type off into the codegen files

* Adds two more missing locations in rustserver

* Moves addVarsRequiredVarsAdditionalProps into anytype and objecttype handling

* More refactoring of where addVarsRequiredVarsAdditionalProps is used

* Samples regenerated
2021-09-27 16:12:40 -07:00

39 KiB

Org.OpenAPITools.Api.FakeApi

All URIs are relative to http://petstore.swagger.io:80/v2

Method HTTP request Description
FakeHealthGet GET /fake/health Health check endpoint
FakeHttpSignatureTest GET /fake/http-signature-test test http signature authentication
FakeOuterBooleanSerialize POST /fake/outer/boolean
FakeOuterCompositeSerialize POST /fake/outer/composite
FakeOuterNumberSerialize POST /fake/outer/number
FakeOuterStringSerialize POST /fake/outer/string
FakePropertyEnumIntegerSerialize POST /fake/property/enum-int
TestBodyWithBinary PUT /fake/body-with-binary
TestBodyWithFileSchema PUT /fake/body-with-file-schema
TestBodyWithQueryParams PUT /fake/body-with-query-params
TestClientModel PATCH /fake To test "client" model
TestEndpointParameters POST /fake Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
TestEnumParameters GET /fake To test enum parameters
TestGroupParameters DELETE /fake Fake endpoint to test group parameters (optional)
TestInlineAdditionalProperties POST /fake/inline-additionalProperties test inline additionalProperties
TestJsonFormData GET /fake/jsonFormData test json serialization of form data
TestQueryParameterCollectionFormat PUT /fake/test-query-parameters

FakeHealthGet

HealthCheckResult FakeHealthGet ()

Health check endpoint

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class FakeHealthGetExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
            var apiInstance = new FakeApi(Configuration.Default);

            try
            {
                // Health check endpoint
                HealthCheckResult result = apiInstance.FakeHealthGet();
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FakeApi.FakeHealthGet: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

HealthCheckResult

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The instance started successfully -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FakeHttpSignatureTest

void FakeHttpSignatureTest (Pet pet, string query1 = null, string header1 = null)

test http signature authentication

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class FakeHttpSignatureTestExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";

            var apiInstance = new FakeApi(Configuration.Default);
            var pet = new Pet(); // Pet | Pet object that needs to be added to the store
            var query1 = query1_example;  // string | query parameter (optional) 
            var header1 = header1_example;  // string | header parameter (optional) 

            try
            {
                // test http signature authentication
                apiInstance.FakeHttpSignatureTest(pet, query1, header1);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FakeApi.FakeHttpSignatureTest: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
pet Pet Pet object that needs to be added to the store
query1 string query parameter [optional]
header1 string header parameter [optional]

Return type

void (empty response body)

Authorization

http_signature_test

HTTP request headers

  • Content-Type: application/json, application/xml
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 The instance started successfully -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FakeOuterBooleanSerialize

bool FakeOuterBooleanSerialize (bool? body = null)

Test serialization of outer boolean types

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class FakeOuterBooleanSerializeExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
            var apiInstance = new FakeApi(Configuration.Default);
            var body = true;  // bool? | Input boolean as post body (optional) 

            try
            {
                bool result = apiInstance.FakeOuterBooleanSerialize(body);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
body bool? Input boolean as post body [optional]

Return type

bool

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 Output boolean -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FakeOuterCompositeSerialize

OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null)

Test serialization of object with outer number type

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class FakeOuterCompositeSerializeExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
            var apiInstance = new FakeApi(Configuration.Default);
            var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional) 

            try
            {
                OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
outerComposite OuterComposite Input composite as post body [optional]

Return type

OuterComposite

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 Output composite -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FakeOuterNumberSerialize

decimal FakeOuterNumberSerialize (decimal? body = null)

Test serialization of outer number types

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class FakeOuterNumberSerializeExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
            var apiInstance = new FakeApi(Configuration.Default);
            var body = 8.14;  // decimal? | Input number as post body (optional) 

            try
            {
                decimal result = apiInstance.FakeOuterNumberSerialize(body);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
body decimal? Input number as post body [optional]

Return type

decimal

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 Output number -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FakeOuterStringSerialize

string FakeOuterStringSerialize (string body = null)

Test serialization of outer string types

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class FakeOuterStringSerializeExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
            var apiInstance = new FakeApi(Configuration.Default);
            var body = body_example;  // string | Input string as post body (optional) 

            try
            {
                string result = apiInstance.FakeOuterStringSerialize(body);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
body string Input string as post body [optional]

Return type

string

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 Output string -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FakePropertyEnumIntegerSerialize

OuterObjectWithEnumProperty FakePropertyEnumIntegerSerialize (OuterObjectWithEnumProperty outerObjectWithEnumProperty)

Test serialization of enum (int) properties with examples

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class FakePropertyEnumIntegerSerializeExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
            var apiInstance = new FakeApi(Configuration.Default);
            var outerObjectWithEnumProperty = new OuterObjectWithEnumProperty(); // OuterObjectWithEnumProperty | Input enum (int) as post body

            try
            {
                OuterObjectWithEnumProperty result = apiInstance.FakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FakeApi.FakePropertyEnumIntegerSerialize: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
outerObjectWithEnumProperty OuterObjectWithEnumProperty Input enum (int) as post body

Return type

OuterObjectWithEnumProperty

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 Output enum (int) -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

TestBodyWithBinary

void TestBodyWithBinary (System.IO.Stream body)

For this test, the body has to be a binary file.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class TestBodyWithBinaryExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
            var apiInstance = new FakeApi(Configuration.Default);
            var body = BINARY_DATA_HERE;  // System.IO.Stream | image to upload

            try
            {
                apiInstance.TestBodyWithBinary(body);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FakeApi.TestBodyWithBinary: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
body System.IO.Stream image to upload

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: image/png
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 Success -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

TestBodyWithFileSchema

void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass)

For this test, the body for this request must reference a schema named File.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class TestBodyWithFileSchemaExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
            var apiInstance = new FakeApi(Configuration.Default);
            var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | 

            try
            {
                apiInstance.TestBodyWithFileSchema(fileSchemaTestClass);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
fileSchemaTestClass FileSchemaTestClass

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 Success -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

TestBodyWithQueryParams

void TestBodyWithQueryParams (string query, User user)

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class TestBodyWithQueryParamsExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
            var apiInstance = new FakeApi(Configuration.Default);
            var query = query_example;  // string | 
            var user = new User(); // User | 

            try
            {
                apiInstance.TestBodyWithQueryParams(query, user);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
query string
user User

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 Success -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

TestClientModel

ModelClient TestClientModel (ModelClient modelClient)

To test "client" model

To test "client" model

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class TestClientModelExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
            var apiInstance = new FakeApi(Configuration.Default);
            var modelClient = new ModelClient(); // ModelClient | client model

            try
            {
                // To test \"client\" model
                ModelClient result = apiInstance.TestClientModel(modelClient);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
modelClient ModelClient client model

Return type

ModelClient

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 successful operation -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

TestEndpointParameters

void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null)

Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트

Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class TestEndpointParametersExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
            // Configure HTTP basic authorization: http_basic_test
            Configuration.Default.Username = "YOUR_USERNAME";
            Configuration.Default.Password = "YOUR_PASSWORD";

            var apiInstance = new FakeApi(Configuration.Default);
            var number = 8.14;  // decimal | None
            var _double = 1.2D;  // double | None
            var patternWithoutDelimiter = patternWithoutDelimiter_example;  // string | None
            var _byte = BYTE_ARRAY_DATA_HERE;  // byte[] | None
            var integer = 56;  // int? | None (optional) 
            var int32 = 56;  // int? | None (optional) 
            var int64 = 789;  // long? | None (optional) 
            var _float = 3.4F;  // float? | None (optional) 
            var _string = _string_example;  // string | None (optional) 
            var binary = BINARY_DATA_HERE;  // System.IO.Stream | None (optional) 
            var date = 2013-10-20;  // DateTime? | None (optional) 
            var dateTime = 2013-10-20T19:20:30+01:00;  // DateTime? | None (optional) 
            var password = password_example;  // string | None (optional) 
            var callback = callback_example;  // string | None (optional) 

            try
            {
                // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 
                apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
number decimal None
_double double None
patternWithoutDelimiter string None
_byte byte[] None
integer int? None [optional]
int32 int? None [optional]
int64 long? None [optional]
_float float? None [optional]
_string string None [optional]
binary System.IO.Stream None [optional]
date DateTime? None [optional]
dateTime DateTime? None [optional]
password string None [optional]
callback string None [optional]

Return type

void (empty response body)

Authorization

http_basic_test

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: Not defined

HTTP response details

Status code Description Response headers
400 Invalid username supplied -
404 User not found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

TestEnumParameters

void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null)

To test enum parameters

To test enum parameters

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class TestEnumParametersExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
            var apiInstance = new FakeApi(Configuration.Default);
            var enumHeaderStringArray = new List<string>(); // List<string> | Header parameter enum test (string array) (optional) 
            var enumHeaderString = enumHeaderString_example;  // string | Header parameter enum test (string) (optional)  (default to -efg)
            var enumQueryStringArray = new List<string>(); // List<string> | Query parameter enum test (string array) (optional) 
            var enumQueryString = enumQueryString_example;  // string | Query parameter enum test (string) (optional)  (default to -efg)
            var enumQueryInteger = 56;  // int? | Query parameter enum test (double) (optional) 
            var enumQueryDouble = 1.2D;  // double? | Query parameter enum test (double) (optional) 
            var enumFormStringArray = new List<string>(); // List<string> | Form parameter enum test (string array) (optional)  (default to $)
            var enumFormString = enumFormString_example;  // string | Form parameter enum test (string) (optional)  (default to -efg)

            try
            {
                // To test enum parameters
                apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
enumHeaderStringArray List<string> Header parameter enum test (string array) [optional]
enumHeaderString string Header parameter enum test (string) [optional] [default to -efg]
enumQueryStringArray List<string> Query parameter enum test (string array) [optional]
enumQueryString string Query parameter enum test (string) [optional] [default to -efg]
enumQueryInteger int? Query parameter enum test (double) [optional]
enumQueryDouble double? Query parameter enum test (double) [optional]
enumFormStringArray List<string> Form parameter enum test (string array) [optional] [default to $]
enumFormString string Form parameter enum test (string) [optional] [default to -efg]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: Not defined

HTTP response details

Status code Description Response headers
400 Invalid request -
404 Not found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

TestGroupParameters

void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null)

Fake endpoint to test group parameters (optional)

Fake endpoint to test group parameters (optional)

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class TestGroupParametersExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
            // Configure HTTP bearer authorization: bearer_test
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new FakeApi(Configuration.Default);
            var requiredStringGroup = 56;  // int | Required String in group parameters
            var requiredBooleanGroup = true;  // bool | Required Boolean in group parameters
            var requiredInt64Group = 789;  // long | Required Integer in group parameters
            var stringGroup = 56;  // int? | String in group parameters (optional) 
            var booleanGroup = true;  // bool? | Boolean in group parameters (optional) 
            var int64Group = 789;  // long? | Integer in group parameters (optional) 

            try
            {
                // Fake endpoint to test group parameters (optional)
                apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
requiredStringGroup int Required String in group parameters
requiredBooleanGroup bool Required Boolean in group parameters
requiredInt64Group long Required Integer in group parameters
stringGroup int? String in group parameters [optional]
booleanGroup bool? Boolean in group parameters [optional]
int64Group long? Integer in group parameters [optional]

Return type

void (empty response body)

Authorization

bearer_test

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
400 Someting wrong -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

TestInlineAdditionalProperties

void TestInlineAdditionalProperties (Dictionary<string, string> requestBody)

test inline additionalProperties

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class TestInlineAdditionalPropertiesExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
            var apiInstance = new FakeApi(Configuration.Default);
            var requestBody = new Dictionary<string, string>(); // Dictionary<string, string> | request body

            try
            {
                // test inline additionalProperties
                apiInstance.TestInlineAdditionalProperties(requestBody);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
requestBody Dictionary<string, string> request body

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 successful operation -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

TestJsonFormData

void TestJsonFormData (string param, string param2)

test json serialization of form data

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class TestJsonFormDataExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
            var apiInstance = new FakeApi(Configuration.Default);
            var param = param_example;  // string | field1
            var param2 = param2_example;  // string | field2

            try
            {
                // test json serialization of form data
                apiInstance.TestJsonFormData(param, param2);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
param string field1
param2 string field2

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 successful operation -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

TestQueryParameterCollectionFormat

void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context, string allowEmpty, Dictionary<string, string> language = null)

To test the collection format in query parameters

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class TestQueryParameterCollectionFormatExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
            var apiInstance = new FakeApi(Configuration.Default);
            var pipe = new List<string>(); // List<string> | 
            var ioutil = new List<string>(); // List<string> | 
            var http = new List<string>(); // List<string> | 
            var url = new List<string>(); // List<string> | 
            var context = new List<string>(); // List<string> | 
            var allowEmpty = allowEmpty_example;  // string | 
            var language = new Dictionary<string, string>(); // Dictionary<string, string> |  (optional) 

            try
            {
                apiInstance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormat: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
pipe List<string>
ioutil List<string>
http List<string>
url List<string>
context List<string>
allowEmpty string
language Dictionary<string, string> [optional]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 Success -

[Back to top] [Back to API list] [Back to Model list] [Back to README]