Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2420819
better support of inline schema in array item
wing328 Apr 10, 2022
699a858
update tests
wing328 Apr 10, 2022
86e4cf2
update samples
wing328 Apr 10, 2022
e0c409e
Merge remote-tracking branch 'origin/master' into inline-model-resolver1
wing328 Apr 10, 2022
287b589
regenerate samples
wing328 Apr 11, 2022
24335b4
fix allof naming, remove files
wing328 Apr 11, 2022
40846c6
add files
wing328 Apr 11, 2022
a278634
update samples
wing328 Apr 11, 2022
019e7c9
update readme
wing328 Apr 11, 2022
63b7d02
fix tests
wing328 Apr 17, 2022
43afbb3
Merge remote-tracking branch 'origin/master' into inline-model-resolver1
wing328 Apr 17, 2022
13deddc
update samples
wing328 Apr 17, 2022
33dc94b
update samples
wing328 Apr 17, 2022
89f4fda
add new files
wing328 Apr 17, 2022
0157114
update test spec
wing328 Apr 18, 2022
d87f512
add back tests
wing328 Apr 18, 2022
f52e1f4
remove unused files
wing328 Apr 18, 2022
53cf35c
comment out python test
wing328 Apr 18, 2022
63a04f2
update js test using own spec
wing328 Apr 18, 2022
e94decd
remove files
wing328 Apr 18, 2022
0c66fb5
Merge remote-tracking branch 'origin/master' into inline-model-resolver1
wing328 Apr 18, 2022
354eafe
remove unused files
wing328 Apr 18, 2022
1e58cbd
remove files
wing328 Apr 18, 2022
7cd1854
remove unused files
wing328 Apr 18, 2022
0ef336a
better handling of allOf with a single type
wing328 Apr 18, 2022
ce929ef
comment out go test
wing328 Apr 18, 2022
a6135cf
remove test_all_of_with_single_ref_single_ref_type.py
wing328 Apr 19, 2022
9190fbb
fix inline resolver, uncomment go test
wing328 Apr 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update test spec
  • Loading branch information
wing328 committed Apr 18, 2022
commit 01571144957206af092928d60a10c4018867b6ce
Original file line number Diff line number Diff line change
Expand Up @@ -3701,15 +3701,16 @@ public void testComposedPropertyTypes() {

modelName = "ObjectWithComposedProperties";
CodegenModel m = codegen.fromModel(modelName, openAPI.getComponents().getSchemas().get(modelName));
// TODO revise the tests below
assertTrue(m.vars.get(0).getIsModel());
/* TODO inline allOf schema are created as separate models and the following assumptions that
the properties are non-model are no longer valid and need to be revised
assertTrue(m.vars.get(1).getIsNumber());
assertTrue(m.vars.get(2).getIsUnboundedInteger());
assertTrue(m.vars.get(3).getIsString());
assertTrue(m.vars.get(4).getIsBoolean());
assertTrue(m.vars.get(5).getIsArray());
assertTrue(m.vars.get(6).getIsNull());
assertTrue(m.vars.get(7).getIsAnyType());
*/
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2197,7 +2197,6 @@ components:
type: array
items:
allOf:
#- $ref: '#/components/schemas/Dog'
- type: object
properties:
breed:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1347,17 +1347,8 @@ components:
type: integer
format: int32
description: User Status
userType:
allOf:
- $ref: '#/components/schemas/UserType'
xml:
name: User
UserType:
type: string
title: UserType
enum:
- admin
- user
Tag:
type: object
properties:
Expand Down Expand Up @@ -1917,3 +1908,17 @@ components:
deprecated: true
items:
$ref: '#/components/schemas/Bar'
AllOfWithSingleRef:
type: object
properties:
username:
type: string
SingleRefType:
allOf:
- $ref: '#/components/schemas/SingleRefType'
SingleRefType:
type: string
title: SingleRefType
enum:
- admin
- user
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ README.md
build.bat
build.sh
docs/AdditionalPropertiesClass.md
docs/AllOfWithSingleRef.md
docs/AllOfWithSingleRefSingleRefType.md
docs/Animal.md
docs/AnotherFakeApi.md
docs/ApiResponse.md
Expand Down Expand Up @@ -52,13 +54,12 @@ docs/Pet.md
docs/PetApi.md
docs/ReadOnlyFirst.md
docs/Return.md
docs/SingleRefType.md
docs/SpecialModelName.md
docs/StoreApi.md
docs/Tag.md
docs/User.md
docs/UserApi.md
docs/UserType.md
docs/UserUserType.md
git_push.sh
mono_nunit_test.sh
src/Org.OpenAPITools.Test/packages.config
Expand All @@ -79,6 +80,8 @@ src/Org.OpenAPITools/Client/IApiAccessor.cs
src/Org.OpenAPITools/Client/IReadableConfiguration.cs
src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs
src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs
src/Org.OpenAPITools/Model/AllOfWithSingleRef.cs
src/Org.OpenAPITools/Model/AllOfWithSingleRefSingleRefType.cs
src/Org.OpenAPITools/Model/Animal.cs
src/Org.OpenAPITools/Model/ApiResponse.cs
src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs
Expand Down Expand Up @@ -121,11 +124,10 @@ src/Org.OpenAPITools/Model/OuterObjectWithEnumProperty.cs
src/Org.OpenAPITools/Model/Pet.cs
src/Org.OpenAPITools/Model/ReadOnlyFirst.cs
src/Org.OpenAPITools/Model/Return.cs
src/Org.OpenAPITools/Model/SingleRefType.cs
src/Org.OpenAPITools/Model/SpecialModelName.cs
src/Org.OpenAPITools/Model/Tag.cs
src/Org.OpenAPITools/Model/User.cs
src/Org.OpenAPITools/Model/UserType.cs
src/Org.OpenAPITools/Model/UserUserType.cs
src/Org.OpenAPITools/Org.OpenAPITools.csproj
src/Org.OpenAPITools/Org.OpenAPITools.nuspec
src/Org.OpenAPITools/Properties/AssemblyInfo.cs
Expand Down
5 changes: 3 additions & 2 deletions samples/client/petstore/csharp/OpenAPIClient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ Class | Method | HTTP request | Description
## Documentation for Models

- [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
- [Model.AllOfWithSingleRef](docs/AllOfWithSingleRef.md)
- [Model.AllOfWithSingleRefSingleRefType](docs/AllOfWithSingleRefSingleRefType.md)
- [Model.Animal](docs/Animal.md)
- [Model.ApiResponse](docs/ApiResponse.md)
- [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
Expand Down Expand Up @@ -193,11 +195,10 @@ Class | Method | HTTP request | Description
- [Model.Pet](docs/Pet.md)
- [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [Model.Return](docs/Return.md)
- [Model.SingleRefType](docs/SingleRefType.md)
- [Model.SpecialModelName](docs/SpecialModelName.md)
- [Model.Tag](docs/Tag.md)
- [Model.User](docs/User.md)
- [Model.UserType](docs/UserType.md)
- [Model.UserUserType](docs/UserUserType.md)


## Documentation for Authorization
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

# Org.OpenAPITools.Model.AllOfWithSingleRef

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Username** | **string** | | [optional]
**SingleRefType** | [**AllOfWithSingleRefSingleRefType**](AllOfWithSingleRefSingleRefType.md) | | [optional]

[[Back to Model list]](../README.md#documentation-for-models)
[[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to README]](../README.md)

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# Org.OpenAPITools.Model.AllOfWithSingleRefSingleRefType

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

[[Back to Model list]](../README.md#documentation-for-models)
[[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to README]](../README.md)

12 changes: 12 additions & 0 deletions samples/client/petstore/csharp/OpenAPIClient/docs/SingleRefType.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# Org.OpenAPITools.Model.SingleRefType

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

[[Back to Model list]](../README.md#documentation-for-models)
[[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to README]](../README.md)

1 change: 0 additions & 1 deletion samples/client/petstore/csharp/OpenAPIClient/docs/User.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Name | Type | Description | Notes
**Password** | **string** | | [optional]
**Phone** | **string** | | [optional]
**UserStatus** | **int** | User Status | [optional]
**UserType** | [**UserUserType**](UserUserType.md) | | [optional]

[[Back to Model list]](../README.md#documentation-for-models)
[[Back to API list]](../README.md#documentation-for-api-endpoints)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.git
*/


using NUnit.Framework;

using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
using Org.OpenAPITools.Client;
using System.Reflection;
using Newtonsoft.Json;

namespace Org.OpenAPITools.Test
{
/// <summary>
/// Class for testing AllOfWithSingleRefSingleRefType
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class AllOfWithSingleRefSingleRefTypeTests
{
// TODO uncomment below to declare an instance variable for AllOfWithSingleRefSingleRefType
//private AllOfWithSingleRefSingleRefType instance;

/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of AllOfWithSingleRefSingleRefType
//instance = new AllOfWithSingleRefSingleRefType();
}

/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{

}

/// <summary>
/// Test an instance of AllOfWithSingleRefSingleRefType
/// </summary>
[Test]
public void AllOfWithSingleRefSingleRefTypeInstanceTest()
{
// TODO uncomment below to test "IsInstanceOf" AllOfWithSingleRefSingleRefType
//Assert.IsInstanceOf(typeof(AllOfWithSingleRefSingleRefType), instance);
}



}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*
* 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.git
*/


using NUnit.Framework;

using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
using Org.OpenAPITools.Client;
using System.Reflection;
using Newtonsoft.Json;

namespace Org.OpenAPITools.Test
{
/// <summary>
/// Class for testing AllOfWithSingleRef
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class AllOfWithSingleRefTests
{
// TODO uncomment below to declare an instance variable for AllOfWithSingleRef
//private AllOfWithSingleRef instance;

/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of AllOfWithSingleRef
//instance = new AllOfWithSingleRef();
}

/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{

}

/// <summary>
/// Test an instance of AllOfWithSingleRef
/// </summary>
[Test]
public void AllOfWithSingleRefInstanceTest()
{
// TODO uncomment below to test "IsInstanceOf" AllOfWithSingleRef
//Assert.IsInstanceOf(typeof(AllOfWithSingleRef), instance);
}


/// <summary>
/// Test the property 'Username'
/// </summary>
[Test]
public void UsernameTest()
{
// TODO unit test for the property 'Username'
}
/// <summary>
/// Test the property 'SingleRefType'
/// </summary>
[Test]
public void SingleRefTypeTest()
{
// TODO unit test for the property 'SingleRefType'
}

}

}
Loading