-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat(csharp): add performances playground #2644
Merged
Merged
Changes from 13 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
81526bd
wip
morganleroi 9086f9e
wip
morganleroi 4f29539
Merge branch 'main' into feat/csharp-performances
morganleroi 85a421d
review
morganleroi 82f71ec
Merge remote-tracking branch 'origin/feat/csharp-performances' into f…
morganleroi 53cd4c6
Merge branch 'main' into feat/csharp-performances
morganleroi 5a6954c
Merge branch 'main' into feat/csharp-performances
morganleroi 2e08dc0
remove duplicate
morganleroi e3a2dd4
remove duplicate
morganleroi c740b8d
remove legacy playground
morganleroi 51fd27b
cleanup
morganleroi 6ec2532
only error
morganleroi dff8548
only error
morganleroi 3436d9b
only error
morganleroi 3aad5f5
change port
morganleroi c2cc015
review
morganleroi 397895c
review
morganleroi 4195970
review
morganleroi a48fad7
review
morganleroi 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
70 changes: 0 additions & 70 deletions
70
clients/algoliasearch-client-csharp/algoliasearch/Models/AbstractSchema.cs
This file was deleted.
Oops, something went wrong.
75 changes: 20 additions & 55 deletions
75
clients/algoliasearch-client-csharp/algoliasearch/Models/Common/AbstractSchema.cs
This file contains 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 |
---|---|---|
@@ -1,65 +1,30 @@ | ||
using System; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Serialization; | ||
|
||
namespace Algolia.Search.Models.Common; | ||
|
||
/// <summary> | ||
/// Abstract base class for oneOf, anyOf schemas in the API specification | ||
/// </summary> | ||
public abstract class AbstractSchema | ||
namespace Algolia.Search.Models.Common | ||
{ | ||
/// <summary> | ||
/// Custom JSON serializer | ||
/// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification | ||
/// </summary> | ||
public static readonly JsonSerializerSettings SerializerSettings = new() | ||
public abstract partial class AbstractSchema | ||
{ | ||
// OpenAPI generated types generally hide default constructors. | ||
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, | ||
MissingMemberHandling = MissingMemberHandling.Error, | ||
ContractResolver = new DefaultContractResolver | ||
{ | ||
NamingStrategy = new CamelCaseNamingStrategy | ||
{ | ||
OverrideSpecifiedNames = false | ||
} | ||
} | ||
}; | ||
|
||
/// <summary> | ||
/// Custom JSON serializer for objects with additional properties | ||
/// </summary> | ||
public static readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings | ||
{ | ||
// OpenAPI generated types generally hide default constructors. | ||
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, | ||
MissingMemberHandling = MissingMemberHandling.Ignore, | ||
ContractResolver = new DefaultContractResolver | ||
{ | ||
NamingStrategy = new CamelCaseNamingStrategy | ||
{ | ||
OverrideSpecifiedNames = false | ||
} | ||
} | ||
}; | ||
|
||
/// <summary> | ||
/// Gets or Sets the actual instance | ||
/// </summary> | ||
public abstract object ActualInstance { get; set; } | ||
/// <summary> | ||
/// Gets or Sets the actual instance | ||
/// </summary> | ||
public abstract Object ActualInstance { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or Sets IsNullable to indicate whether the instance is nullable | ||
/// </summary> | ||
public bool IsNullable { get; protected set; } | ||
/// <summary> | ||
/// Gets or Sets IsNullable to indicate whether the instance is nullable | ||
/// </summary> | ||
public bool IsNullable { get; protected set; } | ||
|
||
/// <summary> | ||
/// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` | ||
/// </summary> | ||
public string SchemaType { get; protected set; } | ||
/// <summary> | ||
/// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` | ||
/// </summary> | ||
public string SchemaType { get; protected set; } | ||
|
||
/// <summary> | ||
/// Converts the instance into JSON string. | ||
/// </summary> | ||
public abstract string ToJson(); | ||
/// <summary> | ||
/// Converts the instance into JSON string. | ||
/// </summary> | ||
public abstract string ToJson(); | ||
} | ||
} |
This file contains 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 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
21 changes: 21 additions & 0 deletions
21
clients/algoliasearch-client-csharp/algoliasearch/Transport/CallType.cs
This file contains 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,21 @@ | ||
using System; | ||
|
||
namespace Algolia.Search.Transport; | ||
|
||
/// <summary> | ||
/// https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/enumeration-types | ||
/// Binary enums beware when adding new values | ||
/// </summary> | ||
[Flags] | ||
public enum CallType | ||
{ | ||
/// <summary> | ||
/// Read Call | ||
/// </summary> | ||
Read = 1, | ||
|
||
/// <summary> | ||
/// Write Call | ||
/// </summary> | ||
Write = 2 | ||
} |
16 changes: 16 additions & 0 deletions
16
clients/algoliasearch-client-csharp/algoliasearch/Transport/HttpScheme.cs
This file contains 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,16 @@ | ||
namespace Algolia.Search.Transport; | ||
|
||
/// <summary> | ||
/// Http Scheme | ||
/// </summary> | ||
public enum HttpScheme | ||
{ | ||
/// <summary> | ||
/// Http | ||
/// </summary> | ||
Http, | ||
/// <summary> | ||
/// Https | ||
/// </summary> | ||
Https | ||
} |
This file contains 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.
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.
is the port always defined ?
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.
if it's -1 maybe it shouldn't be passed
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.
Yes. Done