Skip to content

Commit ef041b6

Browse files
committed
Revert case insensitive path parameter source support because the runtime does not support it
1 parent 1a6049e commit ef041b6

2 files changed

Lines changed: 12 additions & 14 deletions

File tree

src/Dibix.Sdk.CodeGeneration/Lookup/ActionTargetDefinitionResolver.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,20 @@ private ActionParameter CreateActionParameter(string name, TypeReference type, V
129129
if (source is ActionParameterPropertySource propertySource)
130130
{
131131
apiParameterName = propertySource.PropertyName.Split('.')[0];
132-
if (IsUserParameter(propertySource.Definition, propertySource.PropertyName, ref location, ref apiParameterName))
132+
_ = IsUserParameter(propertySource.Definition, propertySource.PropertyName, ref location, ref apiParameterName);
133+
134+
if (propertySource.Definition is PathParameterSource)
133135
{
134-
if (location == ActionParameterLocation.Path && pathParameters.TryGetValue(propertySource.PropertyName, out pathParameter))
136+
// Use case sensitive comparison, because the runtime does not support case insensitive argument resolution
137+
if (!pathParameters.TryGetValue(apiParameterName, out pathParameter) || pathParameter.Name != apiParameterName)
138+
{
139+
Logger.LogError($"Property '{apiParameterName}' not found in path", propertySource.FilePath, propertySource.Line, propertySource.Column);
140+
}
141+
142+
if (pathParameter != null)
143+
{
135144
pathParameter.Visited = true;
145+
}
136146
}
137147
}
138148

src/Dibix.Sdk.CodeGeneration/Registration/ControllerDefinitionProvider.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -644,10 +644,6 @@ private void CollectPropertySourceNodes(ActionParameterPropertySourceBuilder pro
644644
CollectItemPropertySourceNodes(propertySourceBuilder, rootPropertySourceBuilder);
645645
break;
646646

647-
case PathParameterSource _:
648-
ValidatePathProperty(propertySourceBuilder, pathParameters);
649-
break;
650-
651647
default:
652648
return;
653649
}
@@ -741,14 +737,6 @@ private static bool CollectPropertyNode(TypeReference type, ObjectSchema objectS
741737
propertyType = null;
742738
return false;
743739
}
744-
745-
private void ValidatePathProperty(ActionParameterPropertySourceBuilder propertySourceBuilder, IReadOnlyDictionary<string, PathParameter> pathParameters)
746-
{
747-
if (!pathParameters.ContainsKey(propertySourceBuilder.PropertyName))
748-
{
749-
Logger.LogError($"Property '{propertySourceBuilder.PropertyName}' not found in path", propertySourceBuilder.FilePath, propertySourceBuilder.Line, propertySourceBuilder.Column);
750-
}
751-
}
752740
#endregion
753741
}
754742
}

0 commit comments

Comments
 (0)