Skip to content

Commit

Permalink
Revert breaking change to SchemaRepository.Schemas signature
Browse files Browse the repository at this point in the history
  • Loading branch information
rmorris committed Feb 7, 2021
1 parent 0b9b82b commit 4331154
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<LicenseUrl>https://licenses.nuget.org/MIT</LicenseUrl>
<VersionPrefix>6.0.1</VersionPrefix>
<VersionPrefix>6.0.2</VersionPrefix>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public SchemaRepository(string documentName = null)

public string DocumentName { get; }

public IDictionary<string, OpenApiSchema> Schemas { get; private set; } = new SortedDictionary<string, OpenApiSchema>();
public Dictionary<string, OpenApiSchema> Schemas { get; private set; } = new Dictionary<string, OpenApiSchema>();

public void RegisterType(Type type, string schemaId)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public OpenApiDocument GetSwagger(string documentName, string host = null, strin
Paths = GeneratePaths(applicableApiDescriptions, schemaRepository),
Components = new OpenApiComponents
{
Schemas = schemaRepository.Schemas,
Schemas = new SortedDictionary<string, OpenApiSchema>(schemaRepository.Schemas),
SecuritySchemes = new Dictionary<string, OpenApiSecurityScheme>(_options.SecuritySchemes)
},
SecurityRequirements = new List<OpenApiSecurityRequirement>(_options.SecurityRequirements)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ public void GenerateSchema_SupportsOption_SubTypesSelector()

var schema = subject.GenerateSchema(typeof(BaseType), schemaRepository);

Assert.Equal(new[] { "BaseType", "SubType1" }, schemaRepository.Schemas.Keys);
Assert.Equal(new[] { "SubType1", "BaseType" }, schemaRepository.Schemas.Keys);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ public void GenerateSchema_SupportsOption_SubTypesSelector()

var schema = subject.GenerateSchema(typeof(BaseType), schemaRepository);

Assert.Equal(new[] { "BaseType", "SubType1" }, schemaRepository.Schemas.Keys);
Assert.Equal(new[] { "SubType1", "BaseType" }, schemaRepository.Schemas.Keys);
}

[Fact]
Expand Down

0 comments on commit 4331154

Please sign in to comment.