Yes you can access most of ServiceStack's metadata from Metadata property in your AppHost which returns the ServiceMetadata class. When outside your AppHost you can access it from the HostContext.Metadata singleton.
A lot of the information can be accessed from OperationsMap, e.g:
var allServices = HostContext.Metadata.OperationsMap.Values.ToList();
Which will return a List<Operation> containing most of the metadata about a Service, e.g:
- Routes for each operation are available from the
Routes property
- The
RequestType and ResponseType returns the Request DTO Type and the known Response DTO Type
All Request DTOs are DTOs/complex types. The way to access information about each Type is to use C# Reflection methods. You can use the Type.GetSerializableProperties() extension method to get the serializable PropertyInfo[] of a Type.
Note you can also query a lot of this metadata in real-time using the Metadata Debug Template, enabled when you register the TemplatePagesFeature plugin:
Plugins.Add(new TemplatePagesFeature {
EnableDebugTemplate = true, // viewable by Admin users
//EnableDebugTemplateToAll = true // viewable by all users
})
Where you can query ServiceStack metadata of your Services in real-time using ServiceStack Templates: