Example #1
0
        public async Task InvokeAsync(HttpContext context)
        {
            var query = pathResolver.Parse(context.Request.Path);

            if (query.IsHandled && context.Request.Method.Equals("GET"))
            {
                context.Response.ContentType = "application/json";
                context.Response.StatusCode  = 200;

                string authToken = GetAuthorizarionToken(context);


                if (query.NodeType != null)
                {
                    nodeSerializer.StreamSchema(query.NodeType, authToken, context.Response.Body);
                }
                else
                {
                    nodeSerializer.WriteValue(context.Response.Body, authToken, factory.RegisterdTypeNames());
                }

                await context.Response.Body.FlushAsync();
            }
            else
            {
                await _next(context);
            }
        }
Example #2
0
 public void GetSchema(string type)
 {
     SendOkJson();
     _serializer.StreamSchema(_factory.GetTypeByName(type), GetToken(), Response.Body);
 }