Esempio n. 1
0
        public SchemaGenerationTests()
        {
            _schemaRepository = new SchemaRepository();
            var options = new AsyncApiDocumentGeneratorOptions();

            _schemaGenerator = new SchemaGenerator(Options.Create(options));
        }
Esempio n. 2
0
 public static IAsyncApiDocumentProvider Provider(Action<AsyncApiDocumentGeneratorOptions> setupAction = null)
 {
     var options = new AsyncApiDocumentGeneratorOptions();
     setupAction?.Invoke(options);
     var wrappedOptions = Options.Create(options);
     
     var schemaGenerator = new SchemaGenerator(wrappedOptions);
     
     return new AsyncApiDocumentGenerator(Options.Create(options), schemaGenerator);
 }
Esempio n. 3
0
 public SchemaGenerator(IOptions <AsyncApiDocumentGeneratorOptions> options)
 {
     _options = options.Value ?? throw new ArgumentNullException(nameof(options));
 }
Esempio n. 4
0
 public NewtonsoftDataContractResolver(IOptions <AsyncApiDocumentGeneratorOptions> options, JsonSerializerSettings serializerSettings)
 {
     _generatorOptions   = options.Value;
     _serializerSettings = serializerSettings;
     _contractResolver   = serializerSettings.ContractResolver ?? new DefaultContractResolver();
 }
Esempio n. 5
0
 public MessageGenerator(IOptions <AsyncApiDocumentGeneratorOptions> options, IDataContractResolver dataContractResolver)
 {
     _options = options.Value ??
                throw new ArgumentNullException(nameof(options));
     _dataContractResolver = dataContractResolver;
 }