-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Add example allOf with single ref #10948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1341,8 +1341,17 @@ components: | |
type: integer | ||
format: int32 | ||
description: User Status | ||
userType: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI. I'll move these to new model instead of modifying "User" |
||
allOf: | ||
- $ref: '#/components/schemas/UserType' | ||
xml: | ||
name: User | ||
UserType: | ||
type: string | ||
title: UserType | ||
enum: | ||
- admin | ||
- user | ||
Tag: | ||
type: object | ||
properties: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
samples/client/petstore/csharp/OpenAPIClient/docs/UserType.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
# Org.OpenAPITools.Model.UserType | ||
|
||
## 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) | ||
|
71 changes: 71 additions & 0 deletions
71
...les/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/UserTypeTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 UserType | ||
/// </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 UserTypeTests | ||
{ | ||
// TODO uncomment below to declare an instance variable for UserType | ||
//private UserType instance; | ||
|
||
/// <summary> | ||
/// Setup before each test | ||
/// </summary> | ||
[SetUp] | ||
public void Init() | ||
{ | ||
// TODO uncomment below to create an instance of UserType | ||
//instance = new UserType(); | ||
} | ||
|
||
/// <summary> | ||
/// Clean up after each test | ||
/// </summary> | ||
[TearDown] | ||
public void Cleanup() | ||
{ | ||
|
||
} | ||
|
||
/// <summary> | ||
/// Test an instance of UserType | ||
/// </summary> | ||
[Test] | ||
public void UserTypeInstanceTest() | ||
{ | ||
// TODO uncomment below to test "IsInstanceOf" UserType | ||
//Assert.IsInstanceOf(typeof(UserType), instance); | ||
} | ||
|
||
|
||
|
||
} | ||
|
||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kuhnroyal thanks again for the PR. I now recall there's similar change before to another generator do something very similar but some users do not like it.
Let me know when you're free in the coming week and we can discuss further via Slack.