-
Notifications
You must be signed in to change notification settings - Fork 0
Metadata page
ServiceStack will automatically generate a metadata page about the webservice. The metadata can be found under the URL /metadata:
The Metadata page contains:
- List of all visible web services and the endpoints they're accessible on
- Links to a detailed page of each format, with example request and responses
- Links to SOAP 1.1/1.2 WSDLs
- Links to all XSD types for all services
- Links to internally available debug metadata info
- Links to Client examples documentation
The metadata pages provide automatic generated documentation around your services, allowing consumers of your APIs to more easily introspect and provide greater visibility of your services.
You can also optionally add custom annotations and documentation on services which will automatically appear on the metadata pages. Here is an example of a fully annotated Service:
[Api("Service Description")]
[Route("/swagger/{Name}", "GET", Summary = @"GET Summary", Notes = "GET Notes")]
[Route("/swagger/{Name}", "POST", Summary = @"POST Summary", Notes = "POST Notes")]
public class MyRequestDto
{
[ApiMember(Name="Name", Description = "Name Description",
ParameterType = "path", DataType = "string", IsRequired = true)]
public string Name { get; set; }
}If now the detail page of the specific service is inspected, the description configured above will be displayed.
The HTML templates for the metadata pages are maintained as embedded html template resources.
The VFS now lets you replace built-in ServiceStack templates with your own by simply copying the metadata or HtmlFormat Template files you want to customize and placing them in your Website Directory at:
/Templates/HtmlFormat.html // The auto HtmlFormat template
/Templates/IndexOperations.html // The /metadata template
/Templates/OperationControl.html // Individual operation template
Which you can customize locally that ServiceStack will pick up and use instead.
The metadata page is a feature and can be removed by setting:
SetConfig(new HostConfig {
EnableFeatures = Feature.All.Remove(Feature.Metadata)
});This can be extended to disable as many selected features are required, e.g. to also disable SOAP support you can combine with:
SetConfig(new HostConfig {
EnableFeatures = Feature.All.Remove(Feature.Metadata | Feature.Soap11 | Feature.Soap12)
});- Why ServiceStack?
- What is a message based web service?
- Advantages of message based web services
- Why remote services should use separate DTOs
- Getting Started
- Reference
- Clients
- Formats
- View Engines 4. Razor & Markdown Razor
- Hosts
- Security
- Advanced
- Configuration options
- Access HTTP specific features in services
- Logging
- Serialization/deserialization
- Request/response filters
- Filter attributes
- Concurrency Model
- Built-in caching options
- Built-in profiling
- Form Hijacking Prevention
- Auto-Mapping
- HTTP Utils
- Virtual File System
- Config API
- Physical Project Structure
- Modularizing Services
- MVC Integration
- Plugins 3. Request logger 4. Swagger API
- Tests
- Other Languages
- Use Cases
- Performance
- How To
- Future
