Skip to content

Commit 70fe065

Browse files
authored
[UX] Warning the usage of alias in example (#20150)
* Add validation of examples and url for UX metadata files * Add alias check
1 parent 4f4bec7 commit 70fe065

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

src/SpringCloud/UX/Microsoft.AppPlatform/spring-apps-deployments.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"parameterSets": [
1717
{
1818
"parameters": [
19-
"-DeploymentName <String>",
19+
"-Name <String>",
2020
"-AppName <String>",
2121
"-ServiceName <String>",
2222
"-ResourceGroupName <String>",
@@ -42,7 +42,7 @@
4242
"value": "[path.serviceName]"
4343
},
4444
{
45-
"name": "-DeploymentName",
45+
"name": "-Name",
4646
"value": "[path.deploymentName]"
4747
},
4848
{

src/SpringCloud/UX/Microsoft.AppPlatform/spring-apps.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"parameterSets": [
1717
{
1818
"parameters": [
19-
"-AppName <String>",
19+
"-Name <String>",
2020
"-ServiceName <String>",
2121
"-ResourceGroupName <String>",
2222
"[-SubscriptionId <String[]>]"
@@ -33,7 +33,7 @@
3333
"value": "[path.resourceGroupName]"
3434
},
3535
{
36-
"name": "-AppName",
36+
"name": "-Name",
3737
"value": "[path.appName]"
3838
},
3939
{

src/SpringCloud/UX/Microsoft.AppPlatform/spring.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"parameterSets": [
1717
{
1818
"parameters": [
19-
"-ServiceName <String>",
19+
"-Name <String>",
2020
"-ResourceGroupName <String>",
2121
"[-SubscriptionId <String[]>]"
2222
]
@@ -32,7 +32,7 @@
3232
"value": "[path.resourceGroupName]"
3333
},
3434
{
35-
"name": "-ServiceName",
35+
"name": "-Name",
3636
"value": "[path.serviceName]"
3737
},
3838
{

tools/StaticAnalysis/UXMetadataAnalyzer/UXMetadataAnalyzer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ private void ValidateExample(string moduleName, string resourceType, string subR
184184
{
185185
if (alias.Equals(parameterNameInExample, StringComparison.CurrentCultureIgnoreCase))
186186
{
187+
string issueDescription = string.Format("Please use parameter {0} instead of alias {1}", parameterMetadata.Name, alias);
188+
issueLogger.LogUXMetadataIssue(moduleName, resourceType, subResourceType, commandName, 2, issueDescription);
187189
return parameterMetadata.Name;
188190
}
189191
}

0 commit comments

Comments
 (0)