コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OpenApiAppSettingsBase"/> class.
        /// </summary>
        protected OpenApiAppSettingsBase()
            : base()
        {
            var basePath = this.GetBasePath();
            var host     = HostJsonResolver.Resolve(this.Config, basePath);
            var openapi  = OpenApiSettingsJsonResolver.Resolve(this.Config, basePath);

            this.OpenApiInfo    = OpenApiInfoResolver.Resolve(host, openapi, this.Config);
            this.SwaggerAuthKey = this.Config.GetValue <string>("OpenApi:ApiKey");

            this.HttpSettings = host.GetHttpSettings();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="OpenApiHttpTrigger"/> class.
        /// </summary>
        public OpenApiHttpTriggerContext()
        {
            var host = HostJsonResolver.Resolve();

            this.OpenApiInfo  = OpenApiInfoResolver.Resolve(host);
            this.HttpSettings = host.GetHttpSettings();

            var filter = new RouteConstraintFilter();
            var helper = new DocumentHelper(filter);

            this.Document  = new Document(helper);
            this.SwaggerUI = new SwaggerUI();
        }