ServiceStack API Explorer render failure on a specific complex DTO

When using a DTO that contains a complex type (another DTO), API Explorer fails to render anything. After this point, other routes fail to render also using the API Explorer.

DTO(s):

public class Bill
{
    virtual public string BillID { get; set; }
    virtual public string BillNo { get; set; }
    virtual public string Description { get; set; }
    virtual public Nullable<bool> IsEnabled { get; set; }
    virtual public Nullable<decimal> MaximumProductionCapability { get; set; }
    virtual public Nullable<System.DateTime> LastSavedDateTime { get; set; }
    virtual public byte[] RowHash { get; set; }
    virtual public ProductionLine ProductionLine { get; set; } = new ProductionLine();
}
> 
public class ProductionLine
{
    virtual public string ProductionLineID { get; set; }
    virtual public string Name { get; set; }
    virtual public string Description { get; set; }
    virtual public Nullable<bool> IsEnabled { get; set; }
}

Screenshot of the issue:

VS2022 project demonstrating the issue (visit the BillPOSTRequest route at http://localhost:8088/ui/BillPOSTRequest):

https://github.com/Scott31337/SSTest

EDIT:
The issue does not seem to occur “when a DTO contains another DTO”. It does occur for this specific example, however. There must be something special about these DTOs that is causing something in API Explorer to fall over but I cannot isolate it.

When this happens can you please include a screenshot of the JavaScript console errors causing it.

1 Like

Inspecting the error in the browser console suggests this is caused by an errant console.log command - it is trying to access prop.genericArgs[0] when that’s empty - perhaps the log was intended to be within the if condition above it?

The source for this is line 275 of https://github.com/ServiceStack/ServiceStack/blob/main/ServiceStack/src/ServiceStack/modules/ui/components/ApiForm.html

EDIT: I see now it’s been fixed : Null ref check for debug logging in API Explorer · ServiceStack/ServiceStack@f7ba604 · GitHub

Unfortunately this was reported in the middle of a fairly large refactor of API Explorer in order to maximize code reuse with a new UI feature, should hopefully be finished either today or tomorrow with these fixes.

This should now be resolved in the latest v6.0.3 release that’s now available on MyGet.