Add AddJsonOptions to KubernetesClientConfiguration and KubernetesJson (#1257)
* Use camelCase policy when serializing enums * Revert "Use camelCase policy when serializing enums" This reverts commit 467f49d8734bcbd6aabb87447fbd7d21840c4c48. * Add jonSerializerOptions to GenericClient * Add jsonSerializerOptions param * Revert pass deserialization options in GenericClient * Add JsonSerializerOptions to KubernetesClientConfiguration * Use user JsonSerializerOptions in SendRequest and CreateResultAsync * Improve comment * Remove JsonSerializerOptions * Cosmetic * Add AddJsonOptions * Fix example * Fix test * Add test * Add summary * Improve summary * Remove configure from Kubernetes ctor and tests * Add AddJsonOptions to config and test * Support per client json serializer options * Add ConfigureAwait for tests * Check for nullargument
This commit is contained in:
@@ -9,6 +9,8 @@ namespace k8s
|
||||
{
|
||||
public partial class Kubernetes
|
||||
{
|
||||
private readonly JsonSerializerOptions jsonSerializerOptions;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Kubernetes" /> class.
|
||||
/// </summary>
|
||||
@@ -27,6 +29,7 @@ namespace k8s
|
||||
CreateHttpClient(handlers, config);
|
||||
InitializeFromConfig(config);
|
||||
HttpClientTimeout = config.HttpClientTimeout;
|
||||
jsonSerializerOptions = config.JsonSerializerOptions;
|
||||
#if NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER
|
||||
DisableHttp2 = config.DisableHttp2;
|
||||
#endif
|
||||
@@ -155,8 +158,6 @@ namespace k8s
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Set credentials for the Client
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user