Skip to content

Commit

Permalink
[OpenApi] Order properties alphabetically, meaning output stays more …
Browse files Browse the repository at this point in the history
…consistent across runs
  • Loading branch information
barclayadam committed Apr 26, 2023
1 parent f4543aa commit 8b7fb74
Show file tree
Hide file tree
Showing 6 changed files with 2,074 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Blueprint.OpenApi/OpenApiDocumentBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public OpenApiDocument Build()

// First, add the explicit "owned" properties, those that we know come from a particular
// place and are therefore _not_ part of the body
foreach (var property in operation.Properties)
foreach (var property in operation.Properties.OrderBy(p => p.Name))
{
var ownedPropertyDescriptor = allOwned.SingleOrDefault(o => o.Property == property);

Expand Down Expand Up @@ -607,4 +607,4 @@ public override void AppendSchema(JsonSchema schema, string typeNameHint)
schemas[this._typeNameGenerator.Generate(schema, typeNameHint, schemas.Keys)] = schema;
}
}
}
}
Loading

0 comments on commit 8b7fb74

Please sign in to comment.