Skip to content

Commit f81167e

Browse files
committed
Use kebab case for multi-name params
1 parent c1f37ee commit f81167e

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/Microsoft.OpenApi.Hidi/OpenApiService.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ public static void ProcessOpenApiDocument(
2525
FileInfo output,
2626
OpenApiSpecVersion? version,
2727
OpenApiFormat? format,
28-
string filterByOperationIds,
29-
string filterByTags,
30-
string filterByCollection,
28+
string filterbyoperationids,
29+
string filterbytags,
30+
string filterbycollection,
3131
bool inline,
32-
bool resolveExternal)
32+
bool resolveexternal)
3333
{
3434
if (string.IsNullOrEmpty(openapi))
3535
{
@@ -47,7 +47,7 @@ public static void ProcessOpenApiDocument(
4747
var stream = GetStream(openapi);
4848
var result = new OpenApiStreamReader(new OpenApiReaderSettings
4949
{
50-
ReferenceResolution = resolveExternal ? ReferenceResolutionSetting.ResolveAllReferences : ReferenceResolutionSetting.ResolveLocalReferences,
50+
ReferenceResolution = resolveexternal ? ReferenceResolutionSetting.ResolveAllReferences : ReferenceResolutionSetting.ResolveLocalReferences,
5151
RuleSet = ValidationRuleSet.GetDefaultRuleSet()
5252
}
5353
).ReadAsync(stream).GetAwaiter().GetResult();
@@ -56,24 +56,24 @@ public static void ProcessOpenApiDocument(
5656
Func<string, OperationType?, OpenApiOperation, bool> predicate;
5757

5858
// Check if filter options are provided, then execute
59-
if (!string.IsNullOrEmpty(filterByOperationIds) && !string.IsNullOrEmpty(filterByTags))
59+
if (!string.IsNullOrEmpty(filterbyoperationids) && !string.IsNullOrEmpty(filterbytags))
6060
{
6161
throw new InvalidOperationException("Cannot filter by operationIds and tags at the same time.");
6262
}
63-
if (!string.IsNullOrEmpty(filterByOperationIds))
63+
if (!string.IsNullOrEmpty(filterbyoperationids))
6464
{
65-
predicate = OpenApiFilterService.CreatePredicate(operationIds: filterByOperationIds);
65+
predicate = OpenApiFilterService.CreatePredicate(operationIds: filterbyoperationids);
6666
document = OpenApiFilterService.CreateFilteredDocument(document, predicate);
6767
}
68-
if (!string.IsNullOrEmpty(filterByTags))
68+
if (!string.IsNullOrEmpty(filterbytags))
6969
{
70-
predicate = OpenApiFilterService.CreatePredicate(tags: filterByTags);
70+
predicate = OpenApiFilterService.CreatePredicate(tags: filterbytags);
7171
document = OpenApiFilterService.CreateFilteredDocument(document, predicate);
7272
}
7373

74-
if (!string.IsNullOrEmpty(filterByCollection))
74+
if (!string.IsNullOrEmpty(filterbycollection))
7575
{
76-
var fileStream = GetStream(filterByCollection);
76+
var fileStream = GetStream(filterbycollection);
7777
var requestUrls = ParseJsonCollectionFile(fileStream);
7878
predicate = OpenApiFilterService.CreatePredicate(requestUrls: requestUrls, source:document);
7979
document = OpenApiFilterService.CreateFilteredDocument(document, predicate);

src/Microsoft.OpenApi.Hidi/Program.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ static async Task<int> Main(string[] args)
3131
var inlineOption = new Option("--inline", "Inline $ref instances", typeof(bool));
3232
inlineOption.AddAlias("-i");
3333
;
34-
var resolveExternalOption = new Option("--resolveExternal", "Resolve external $refs", typeof(bool));
34+
var resolveExternalOption = new Option("--resolve-external", "Resolve external $refs", typeof(bool));
3535
resolveExternalOption.AddAlias("-ex");
3636
;
37-
var filterByOperationIdsOption = new Option("--filterByOperationIds", "Filters OpenApiDocument by OperationId(s) provided", typeof(string));
37+
var filterByOperationIdsOption = new Option("--filter-by-operationids", "Filters OpenApiDocument by OperationId(s) provided", typeof(string));
3838
filterByOperationIdsOption.AddAlias("-op");
3939
;
40-
var filterByTagsOption = new Option("--filterByTags", "Filters OpenApiDocument by Tag(s) provided", typeof(string));
40+
var filterByTagsOption = new Option("--filter-by-tags", "Filters OpenApiDocument by Tag(s) provided", typeof(string));
4141
filterByTagsOption.AddAlias("-t");
4242
;
43-
var filterByCollectionOption = new Option("--filterByCollection", "Filters OpenApiDocument by Postman collection provided", typeof(string));
43+
var filterByCollectionOption = new Option("--filter-by-collection", "Filters OpenApiDocument by Postman collection provided", typeof(string));
4444
filterByCollectionOption.AddAlias("-c");
4545

4646
var validateCommand = new Command("validate")

0 commit comments

Comments
 (0)