Skip to content

Commit

Permalink
fix: aligns json methods to simply call into media type methods
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <[email protected]>
  • Loading branch information
baywet committed Oct 15, 2024
1 parent 9f6cff9 commit 29a94c0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static partial class KiotaJsonSerializer
#else
public static Task<IParsable?> DeserializeAsync(Type targetType, string serializedRepresentation, CancellationToken cancellationToken = default)
#endif
=> KiotaSerializer.KiotaDeserializationWrapperFactory.Create(targetType).DeserializeAsync(_jsonContentType, serializedRepresentation, cancellationToken);
=> KiotaSerializer.DeserializeAsync(targetType, _jsonContentType, serializedRepresentation, cancellationToken);

/// <summary>
/// Deserializes the given stream into an object.
Expand All @@ -46,7 +46,7 @@ public static partial class KiotaJsonSerializer
#else
public static Task<IParsable?> DeserializeAsync(Type targetType, Stream stream, CancellationToken cancellationToken = default)
#endif
=> KiotaSerializer.KiotaDeserializationWrapperFactory.Create(targetType).DeserializeAsync(_jsonContentType, stream, cancellationToken);
=> KiotaSerializer.DeserializeAsync(targetType, _jsonContentType, stream, cancellationToken);

/// <summary>
/// Deserializes the given stream into a collection of objects based on the content type.
Expand All @@ -58,7 +58,7 @@ public static partial class KiotaJsonSerializer
[RequiresDynamicCode("Activator creates an instance of a generic class with the Target Type as the generic type argument.")]
#endif
public static Task<IEnumerable<IParsable>> DeserializeCollectionAsync(Type targetType, Stream stream, CancellationToken cancellationToken = default)
=> KiotaSerializer.KiotaDeserializationWrapperFactory.Create(targetType).DeserializeCollectionAsync(_jsonContentType, stream, cancellationToken);
=> KiotaSerializer.DeserializeCollectionAsync(targetType, _jsonContentType, stream, cancellationToken);

/// <summary>
/// Deserializes the given stream into a collection of objects based on the content type.
Expand All @@ -70,5 +70,5 @@ public static Task<IEnumerable<IParsable>> DeserializeCollectionAsync(Type targe
[RequiresDynamicCode("Activator creates an instance of a generic class with the Target Type as the generic type argument.")]
#endif
public static Task<IEnumerable<IParsable>> DeserializeCollectionAsync(Type targetType, string serializedRepresentation, CancellationToken cancellationToken = default)
=> KiotaSerializer.KiotaDeserializationWrapperFactory.Create(targetType).DeserializeCollectionAsync(_jsonContentType, serializedRepresentation, cancellationToken);
=> KiotaSerializer.DeserializeCollectionAsync(targetType, _jsonContentType, serializedRepresentation, cancellationToken);
}

0 comments on commit 29a94c0

Please sign in to comment.