From 11e05c68d0251b0b7b4960a0a8354610d2241c45 Mon Sep 17 00:00:00 2001 From: Eugene Kyba Date: Tue, 14 Jan 2025 12:56:47 +0000 Subject: [PATCH] Fixed formatting --- src/SwaggerProvider.DesignTime/v3/DefinitionCompiler.fs | 9 +++++---- tests/SwaggerProvider.Tests/Schema.Parser.Tests.fs | 6 ++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/SwaggerProvider.DesignTime/v3/DefinitionCompiler.fs b/src/SwaggerProvider.DesignTime/v3/DefinitionCompiler.fs index 812adaa..09ffae1 100644 --- a/src/SwaggerProvider.DesignTime/v3/DefinitionCompiler.fs +++ b/src/SwaggerProvider.DesignTime/v3/DefinitionCompiler.fs @@ -250,15 +250,16 @@ type DefinitionCompiler(schema: OpenApiDocument, provideNullable) as this = match schemaObj.AllOf.Count > 0 with | true -> schemaObj.AllOf - |> Seq.append [schemaObj] - |> Seq.collect (fun x -> x.Properties) + |> Seq.append [ schemaObj ] + |> Seq.collect(fun x -> x.Properties) | false -> schemaObj.Properties + let schemaObjRequired = match schemaObj.AllOf.Count > 0 with | true -> schemaObj.AllOf - |> Seq.append [schemaObj] - |> Seq.collect (fun x -> x.Required) + |> Seq.append [ schemaObj ] + |> Seq.collect(fun x -> x.Required) |> System.Collections.Generic.HashSet :> System.Collections.Generic.ISet | false -> schemaObj.Required diff --git a/tests/SwaggerProvider.Tests/Schema.Parser.Tests.fs b/tests/SwaggerProvider.Tests/Schema.Parser.Tests.fs index b625105..caff84b 100644 --- a/tests/SwaggerProvider.Tests/Schema.Parser.Tests.fs +++ b/tests/SwaggerProvider.Tests/Schema.Parser.Tests.fs @@ -90,11 +90,13 @@ let ``Parse PetStore``() = ) [] -let ``Add definition for schema with only allOf properties`` () = +let ``Add definition for schema with only allOf properties``() = let definitions = - __SOURCE_DIRECTORY__ + "/../SwaggerProvider.ProviderTests/Schemas/v3/issue255.yaml" + __SOURCE_DIRECTORY__ + + "/../SwaggerProvider.ProviderTests/Schemas/v3/issue255.yaml" |> File.ReadAllText |> V3.testSchema + definitions |> shouldHaveLength 1 definitions[0].GetDeclaredProperty("FirstName") |> shouldNotEqual null