From 05ccb4d8f1bbe3fb64e117136b4a89bcfb0b0b33 Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 27 Oct 2020 19:21:35 +0800 Subject: Split front and back end. --- .../Swagger/ByteDataRequestOperationProcessor.cs | 27 ---------------------- 1 file changed, 27 deletions(-) delete mode 100644 Timeline/Swagger/ByteDataRequestOperationProcessor.cs (limited to 'Timeline/Swagger/ByteDataRequestOperationProcessor.cs') diff --git a/Timeline/Swagger/ByteDataRequestOperationProcessor.cs b/Timeline/Swagger/ByteDataRequestOperationProcessor.cs deleted file mode 100644 index 887831ac..00000000 --- a/Timeline/Swagger/ByteDataRequestOperationProcessor.cs +++ /dev/null @@ -1,27 +0,0 @@ -using NJsonSchema; -using NSwag; -using NSwag.Generation.Processors; -using NSwag.Generation.Processors.Contexts; -using System.Linq; -using Timeline.Models; - -namespace Timeline.Swagger -{ - /// - /// Coerce ByteData body type into the right one. - /// - public class ByteDataRequestOperationProcessor : IOperationProcessor - { - /// - public bool Process(OperationProcessorContext context) - { - var hasByteDataBody = context.MethodInfo.GetParameters().Where(p => p.ParameterType == typeof(ByteData)).Any(); - if (hasByteDataBody) - { - var bodyParameter = context.OperationDescription.Operation.Parameters.Where(p => p.Kind == OpenApiParameterKind.Body).Single(); - bodyParameter.Schema = JsonSchema.FromType(); - } - return true; - } - } -} -- cgit v1.2.3