Beispiel #1
0
        public static IStitchingBuilder AddSchemaFromHttp(
            this IStitchingBuilder builder,
            NameString name)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            name.EnsureNotEmpty(nameof(name));

            builder.AddSchema(name, s =>
            {
                HttpClient httpClient =
                    s.GetRequiredService <IHttpClientFactory>()
                    .CreateClient(name);
                return(IntrospectionClient.LoadSchema(httpClient));
            });

            return(builder);
        }