I’m not sure if I follow you.
I’ve rewritten the classes into each of their own Coded Source File:
using System.Collections.Generic;
namespace API_Library.RegisterCenter.CodedWorkflows.DeserializeVehicles
{
public class VehicleData
{
public List<VehicleInfo> VehicleInfos { get; set; }
}
}
namespace API_Library.RegisterCenter.CodedWorkflows.DeserializeVehicles
{
public class VehicleInfo
{
public string LicenseNumber { get; set; }
public string Brand { get; set; }
public string Model { get; set; }
public int Year { get; set; }
public string UnregisteredDate { get; set; }
}
}
This is in a coded workflow
using System.Collections.Generic;
using UiPath.CodedWorkflows;
using Newtonsoft.Json;
namespace API_Library.RegisterCenter.CodedWorkflows.DeserializeVehicles
{
public class DeserializeResponse : CodedWorkflow
{
[Workflow]
public List<VehicleInfo> Execute(string JSONInput)
{
return JsonConvert.DeserializeObject<VehicleData>(JSONInput).VehicleInfos;
}
}
}
This still yields
Error Could not load file C:.…\API_Library_RegisterCenter\Vehicles\POST Vehicles.xaml. Reason: Cannot create unknown type ‘{http://schemas.microsoft.com/netfx/2009/xaml/activities}Variable({clr-namespace:System.Collections.Generic;assembly=System.Private.CoreLib}List({clr-namespace:API_Library.RegisterCenter.CodedWorkflows.DeserializeVehicles;assembly=API_Library.RegisterCenter.Core}VehicleInfo))’.
But if I create the Coded Source File in a separate library and then import that library it works.

