Code-first Services Framework
ServiceStack is predominantly a code-first Services framework with many of its features centered around your code-first POCO's. Without a well-defined POCO to define your Service there's no source definition for ServiceStack's metadata services to refer to, or concrete type to deserialize into, etc.
Returning Custom JSON or loose-typed .NET Collections
Depending on what you're trying to achieve with dynamic untyped data, your Service implementation could return a custom JSON string serialized with the desired Service Response. To help with generating JSON you can return an untyped collection of List<T> and Dictionary<string,T> to match the shape of the JSON you want to return.
Although not having a typed model loses many of the benefit of using well-defined DTO's, where clients will no longer have a typed API to call or consume your Services with.
Automatically generating Types and dynamically registering Services
An advanced option would be to use code-generation to dynamically generate Types and Service implementations.
A similar approach is taken with the implementation of AutoQuery which uses Reflection.Emit to dynamically generate missing Service implementations for AutoQuery Request DTO's.
After code-generating a new Service implementation it can be registered with ServiceStack using the IAppHost.RegisterService() API:
var serviceType = GenerateMissingServices(misingRequestTypes);
appHost.RegisterService(serviceType);
This approach works well for AutoQuery as it uses the Request DTO as a blue-print to generate the Service implementation from, so clients still benefit from having a typed Request and Generic Response DTO to call AutoQuery Services without needing any code-gen.
You could also use this approach to dynamically generate the Service Models (DTOs) as well, but as there's no concrete type available, clients would need to use ServiceStack's Add ServiceStack Reference feature to generate the typed DTO's for their preferred language.
List<string>,Dictionary<string,string>? - mythzDictionary<string, object>(hoping that it will work...). - user2173353