CreateWithDefinitions() public static method

Creates a new resolver, adds the given schema definitions and registers an exception schema if available.
public static CreateWithDefinitions ( NJsonSchema.CodeGeneration.CSharp.CSharpGeneratorSettings settings, JsonSchema4>.IDictionary definitions ) : SwaggerToCSharpTypeResolver
settings NJsonSchema.CodeGeneration.CSharp.CSharpGeneratorSettings The settings.
definitions JsonSchema4>.IDictionary The definitions.
return SwaggerToCSharpTypeResolver
コード例 #1
0
 /// <summary>Initializes a new instance of the <see cref="SwaggerToCSharpClientGenerator" /> class.</summary>
 /// <param name="service">The service.</param>
 /// <param name="settings">The settings.</param>
 /// <exception cref="System.ArgumentNullException">service</exception>
 /// <exception cref="ArgumentNullException"><paramref name="service" /> is <see langword="null" />.</exception>
 public SwaggerToCSharpClientGenerator(SwaggerService service, SwaggerToCSharpClientGeneratorSettings settings)
     : this(service, settings, SwaggerToCSharpTypeResolver.CreateWithDefinitions(settings.CSharpGeneratorSettings, service.Definitions))
 {
 }
コード例 #2
0
 /// <summary>Initializes a new instance of the <see cref="SwaggerToCSharpWebApiControllerGenerator" /> class.</summary>
 /// <param name="document">The Swagger document.</param>
 /// <param name="settings">The settings.</param>
 /// <exception cref="ArgumentNullException"><paramref name="document" /> is <see langword="null" />.</exception>
 public SwaggerToCSharpWebApiControllerGenerator(SwaggerDocument document, SwaggerToCSharpWebApiControllerGeneratorSettings settings)
     : this(document, settings, SwaggerToCSharpTypeResolver.CreateWithDefinitions(settings.CSharpGeneratorSettings, document.Definitions))
 {
 }