I started using Swashbuckle with a web API. None of my types display correctly in my Swagger interface. For each method, I see something like this (unrendered):
<span class="strong">Typename is not defined!</span>
So, I researched and found this in my Swagger description file for many of my methods:
{$ref: "#/definitions/Typename", vendorExtensions: {}}
typeName exists in the list of definitions ... but at the bottom. They all have a lower case, but all $ref are uppercase.
How to fix it?
Editing Bounty: More information is available on request, I'm just not sure what else may be relevant.
[assembly: WebActivatorEx.PreApplicationStartMethod(typeof(SwaggerConfig), "Register")] public class SwaggerConfig { public static void Register() { var thisAssembly = typeof(SwaggerConfig).Assembly; GlobalConfiguration.Configuration .EnableSwagger(c => { c.SingleApiVersion("v1", "MyNamespace.Api"); c.IncludeXmlComments(Path.Combine( AppDomain.CurrentDomain.GetDataDirectoryPath(), "MyNamespace.Api.XML")); }) .EnableSwaggerUi(); } }
source share