forked from loafle/openapi-generator-original
* Update csharp oneOf and anyOf mustache templates to accept primitive, object, and array types when deserializing Add bug openapi spec Remove generated files Add test endpoints Generate base on spec Remove issue spec as it is moved into sample test spec Add back in number and int Round trip anyOf/oneOf serialization tests Generate classes with int/num types Do through converter instead of object ctor Regen models Use convert methods Regen models Test data Add enum Remove enums Regenned models * update sha256 * use new spec * skip tests * update workflow * fix --------- Co-authored-by: Ruben Aguilar <ruben.aguilar@forgeglobal.com>
Org.OpenAPITools - the C# library for the OpenAPI 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 OpenAPI Generator project:
- API version: 1.0.0
- SDK version: 1.0.0
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
Version support
This generator should support all current LTS versions of Unity
- Unity 2020.3 (LTS) and up
- .NET Standard 2.1 / .NET Framework
Dependencies
- Newtonsoft.Json - 3.0.2 or later
- Unity Test Framework - 1.1.33 or later
Installation
Add the dependencies to Packages/manifest.json
{
"dependencies": {
...
"com.unity.nuget.newtonsoft-json": "3.0.2",
"com.unity.test-framework": "1.1.33",
}
}
Then use the namespaces:
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
Getting Started
using System;
using System.Collections.Generic;
using UnityEngine;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Org.OpenAPIToolsExample
{
public class Call123TestSpecialTagsExample : MonoBehaviour
{
async void Start()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new AnotherFakeApi(config);
var modelClient = new ModelClient(); // ModelClient | client model
try
{
// To test special tags
ModelClient result = await apiInstance.Call123TestSpecialTagsAsync(modelClient);
Debug.Log(result);
Debug.Log("Done!");
}
catch (ApiException e)
{
Debug.LogError("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message );
Debug.LogError("Status Code: "+ e.ErrorCode);
Debug.LogError(e.StackTrace);
}
}
}
}
Documentation for API Endpoints
All URIs are relative to http://petstore.swagger.io:80/v2
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AnotherFakeApi | Call123TestSpecialTags | PATCH /another-fake/dummy | To test special tags |
| DefaultApi | FooGet | GET /foo | |
| DefaultApi | GetCountry | POST /country | |
| DefaultApi | Hello | GET /hello | Hello |
| DefaultApi | RolesReportGet | GET /roles/report | |
| DefaultApi | Test | GET /test | Retrieve an existing Notificationtest's Elements |
| FakeApi | FakeHealthGet | GET /fake/health | Health check endpoint |
| FakeApi | FakeOuterBooleanSerialize | POST /fake/outer/boolean | |
| FakeApi | FakeOuterCompositeSerialize | POST /fake/outer/composite | |
| FakeApi | FakeOuterNumberSerialize | POST /fake/outer/number | |
| FakeApi | FakeOuterStringSerialize | POST /fake/outer/string | |
| FakeApi | GetArrayOfEnums | GET /fake/array-of-enums | Array of Enums |
| FakeApi | TestAdditionalPropertiesReference | POST /fake/additionalProperties-reference | test referenced additionalProperties |
| FakeApi | TestBodyWithFileSchema | PUT /fake/body-with-file-schema | |
| FakeApi | TestBodyWithQueryParams | PUT /fake/body-with-query-params | |
| 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 |
| FakeApi | TestGroupParameters | DELETE /fake | Fake endpoint to test group parameters (optional) |
| FakeApi | TestInlineAdditionalProperties | POST /fake/inline-additionalProperties | test inline additionalProperties |
| FakeApi | TestInlineFreeformAdditionalProperties | POST /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties |
| FakeApi | TestJsonFormData | GET /fake/jsonFormData | test json serialization of form data |
| FakeApi | TestQueryParameterCollectionFormat | PUT /fake/test-query-parameters | |
| FakeApi | TestStringMapReference | POST /fake/stringMap-reference | test referenced string map |
| FakeClassnameTags123Api | TestClassname | PATCH /fake_classname_test | To test class name in snake case |
| 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 |
| PetApi | UploadFileWithRequiredFile | POST /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) |
| StoreApi | DeleteOrder | DELETE /store/order/{order_id} | Delete purchase order by ID |
| StoreApi | GetInventory | GET /store/inventory | Returns pet inventories by status |
| StoreApi | GetOrderById | GET /store/order/{order_id} | 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.Activity
- Model.ActivityOutputElementRepresentation
- Model.AdditionalPropertiesClass
- Model.Animal
- Model.ApiResponse
- Model.Apple
- Model.AppleReq
- Model.ArrayOfArrayOfNumberOnly
- Model.ArrayOfNumberOnly
- Model.ArrayTest
- Model.Banana
- Model.BananaReq
- Model.BasquePig
- Model.Capitalization
- Model.Cat
- Model.Category
- Model.ChildCat
- Model.ClassModel
- Model.ComplexQuadrilateral
- Model.DanishPig
- Model.DateOnlyClass
- Model.DeprecatedObject
- Model.Dog
- Model.Drawing
- Model.EnumArrays
- Model.EnumClass
- Model.EnumTest
- Model.EquilateralTriangle
- Model.File
- Model.FileSchemaTestClass
- Model.Foo
- Model.FooGetDefaultResponse
- Model.FormatTest
- Model.Fruit
- Model.FruitReq
- Model.GmFruit
- Model.GrandparentAnimal
- Model.HasOnlyReadOnly
- Model.HealthCheckResult
- Model.IsoscelesTriangle
- Model.List
- Model.LiteralStringClass
- Model.Mammal
- Model.MapTest
- Model.MixedPropertiesAndAdditionalPropertiesClass
- Model.Model200Response
- Model.ModelClient
- Model.Name
- Model.NotificationtestGetElementsV1ResponseMPayload
- Model.NullableClass
- Model.NullableGuidClass
- Model.NullableShape
- Model.NumberOnly
- Model.ObjectWithDeprecatedFields
- Model.OneOfString
- Model.Order
- Model.OuterComposite
- Model.OuterEnum
- Model.OuterEnumDefaultValue
- Model.OuterEnumInteger
- Model.OuterEnumIntegerDefaultValue
- Model.OuterEnumTest
- Model.ParentPet
- Model.Pet
- Model.Pig
- Model.PolymorphicProperty
- Model.Quadrilateral
- Model.QuadrilateralInterface
- Model.ReadOnlyFirst
- Model.RequiredClass
- Model.Return
- Model.RolesReportsHash
- Model.RolesReportsHashRole
- Model.ScaleneTriangle
- Model.Shape
- Model.ShapeInterface
- Model.ShapeOrNull
- Model.SimpleQuadrilateral
- Model.SpecialModelName
- Model.Tag
- Model.TestCollectionEndingWithWordList
- Model.TestCollectionEndingWithWordListObject
- Model.TestInlineFreeformAdditionalPropertiesRequest
- Model.Triangle
- Model.TriangleInterface
- Model.User
- Model.Whale
- Model.Zebra
- Model.ZeroBasedEnum
- Model.ZeroBasedEnumClass
Documentation for Authorization
Authentication schemes defined for the API:
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
api_key
- Type: API key
- API key parameter name: api_key
- Location: HTTP header
api_key_query
- Type: API key
- API key parameter name: api_key_query
- Location: URL query string
http_basic_test
- Type: HTTP basic authentication
bearer_test
- Type: Bearer Authentication
http_signature_test
- Type: HTTP signature authentication