forked from RicoSuter/NSwag
-
Notifications
You must be signed in to change notification settings - Fork 0
AssemblyTypeToSwaggerGenerator
Rico Suter edited this page May 14, 2016
·
9 revisions
Package: NSwag.AssemblyLoader
The following code generates a Swagger specification for the given type and no operations. The intention is to generate DTO classes for other programming platforms from via a Swagger specification.
var settings = new AssemblyTypeToSwaggerGenerator
{
AssemblyPath = "path/to/assembly.dll"
};
var generator = new AssemblyTypeToSwaggerGenerator(settings);
var service = generator.Generate(new string[] { "FullTypeName" });
var swaggerSpecification = service.ToJson();The external assembly is loaded in a seperate AppDomain so that there are no type collisions and the assembly can be correctly unloaded.
More information: AssemblyTypeToSwaggerGeneratorSettings.cs