mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-05-28 01:52:27 -04:00
Fixing the json serializer
This commit is contained in:
@@ -11,14 +11,12 @@ namespace Kyoo.Controllers
|
||||
{
|
||||
JsonProperty property = base.CreateProperty(member, memberSerialization);
|
||||
|
||||
// TODO this get called only once and get cached.
|
||||
|
||||
// if (member?.GetCustomAttributes<LoadableRelationAttribute>() != null)
|
||||
// property.NullValueHandling = NullValueHandling.Ignore;
|
||||
// if (member?.GetCustomAttributes<SerializeIgnoreAttribute>() != null)
|
||||
// property.ShouldSerialize = _ => false;
|
||||
// if (member?.GetCustomAttributes<DeserializeIgnoreAttribute>() != null)
|
||||
// property.ShouldDeserialize = _ => false;
|
||||
if (member?.GetCustomAttribute<LoadableRelationAttribute>() != null)
|
||||
property.NullValueHandling = NullValueHandling.Ignore;
|
||||
if (member?.GetCustomAttribute<SerializeIgnoreAttribute>() != null)
|
||||
property.ShouldSerialize = _ => false;
|
||||
if (member?.GetCustomAttribute<DeserializeIgnoreAttribute>() != null)
|
||||
property.ShouldDeserialize = _ => false;
|
||||
return property;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Kyoo.CommonApi
|
||||
where.Remove(key);
|
||||
}
|
||||
|
||||
string[] fields = context.HttpContext.Request.Query["fields"].ToArray();
|
||||
string[] fields = string.Join(',', context.HttpContext.Request.Query["fields"]).Split(',');
|
||||
|
||||
context.HttpContext.Items["fields"] = fields;
|
||||
if (context.ActionDescriptor is ControllerActionDescriptor descriptor)
|
||||
@@ -68,6 +68,7 @@ namespace Kyoo.CommonApi
|
||||
Type pageType = Utility.GetGenericDefinition(result.DeclaredType, typeof(Page<>));
|
||||
|
||||
|
||||
// TODO loading is case sensitive. Maybe convert them in the first check.
|
||||
if (pageType != null)
|
||||
{
|
||||
foreach (IResource resource in ((dynamic)result.Value).Items)
|
||||
|
||||
Reference in New Issue
Block a user