Skip to content

Commit 2ccb783

Browse files
committed
Rename ActionParameterPropertySource.PropertyName -> PropertyPath
1 parent 358b3d4 commit 2ccb783

10 files changed

Lines changed: 17 additions & 17 deletions

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ private ActionParameter CreateActionParameter(string name, TypeReference type, b
129129
PathParameter pathParameter;
130130
if (source is ActionParameterPropertySource propertySource)
131131
{
132-
apiParameterName = propertySource.PropertyName.Split('.')[0];
133-
_ = IsUserParameter(propertySource.Definition, propertySource.PropertyName, ref location, ref apiParameterName);
132+
apiParameterName = propertySource.PropertyPath.Split('.')[0];
133+
_ = IsUserParameter(propertySource.Definition, propertySource.PropertyPath, ref location, ref apiParameterName);
134134

135135
if (propertySource.Definition is PathParameterSource)
136136
{

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ private static ActionParameterLocation ResolveParameterLocation(ActionParameterS
101101

102102
case ActionParameterPropertySource actionParameterPropertySource:
103103
ActionParameterLocation location = ActionParameterLocation.NonUser;
104-
apiParameterName = actionParameterPropertySource.PropertyName.Split('.')[0];
105-
IsUserParameter(actionParameterPropertySource.Definition, actionParameterPropertySource.PropertyName, ref location, ref apiParameterName);
104+
apiParameterName = actionParameterPropertySource.PropertyPath.Split('.')[0];
105+
IsUserParameter(actionParameterPropertySource.Definition, actionParameterPropertySource.PropertyPath, ref location, ref apiParameterName);
106106
return location;
107107

108108
case null when explicitLocation is not null: return explicitLocation.Value;

src/Dibix.Sdk.CodeGeneration/Model/ActionParameterClaimSource.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ internal sealed class ActionParameterClaimSource : ActionParameterSource, IActio
55
private readonly ClaimParameterSource _claimParameterSource;
66

77
public ActionParameterSourceDefinition Definition => _claimParameterSource;
8-
public string PropertyName { get; }
8+
public string PropertyPath { get; }
99
public SourceLocation Location { get; }
10-
public string ClaimType => _claimParameterSource.GetClaimTypeName(PropertyName);
10+
public string ClaimType => _claimParameterSource.GetClaimTypeName(PropertyPath);
1111
public override TypeReference Type { get; }
1212

1313
public ActionParameterClaimSource(ClaimParameterSource claimParameterSource, string propertyName, SourceLocation location)
1414
{
1515
_claimParameterSource = claimParameterSource;
1616
Type = claimParameterSource.TryGetType(propertyName);
17-
PropertyName = propertyName;
17+
PropertyPath = propertyName;
1818
Location = location;
1919
}
2020
}

src/Dibix.Sdk.CodeGeneration/Model/ActionParameterPropertySource.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ namespace Dibix.Sdk.CodeGeneration
77
internal sealed class ActionParameterPropertySource : ActionParameterSource, IActionParameterPropertySource, IActionParameterNestedPropertySource
88
{
99
public ActionParameterSourceDefinition Definition { get; }
10-
public string PropertyName { get; }
10+
public string PropertyPath { get; }
1111
public string Converter { get; }
1212
public IReadOnlyCollection<ActionParameterPropertySourceNode> Nodes { get; }
1313
public IReadOnlyCollection<ActionParameterItemSource> ItemSources { get; }
1414
public SourceLocation Location { get; }
1515
public override TypeReference Type => Nodes.LastOrDefault()?.Property?.Type;
1616

17-
public ActionParameterPropertySource(ActionParameterSourceDefinition definition, string propertyName, SourceLocation location, string converter, IList<ActionParameterPropertySourceNode> nodes, IList<ActionParameterItemSource> itemSources)
17+
public ActionParameterPropertySource(ActionParameterSourceDefinition definition, string propertyPath, SourceLocation location, string converter, IList<ActionParameterPropertySourceNode> nodes, IList<ActionParameterItemSource> itemSources)
1818
{
1919
Definition = definition;
20-
PropertyName = propertyName;
20+
PropertyPath = propertyPath;
2121
Location = location;
2222
Converter = converter;
2323
Nodes = new ReadOnlyCollection<ActionParameterPropertySourceNode>(nodes);

src/Dibix.Sdk.CodeGeneration/Model/IActionParameterPropertySource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
internal interface IActionParameterPropertySource
44
{
55
ActionParameterSourceDefinition Definition { get; }
6-
string PropertyName { get; }
6+
string PropertyPath { get; }
77
SourceLocation Location { get; }
88
}
99
}

src/Dibix.Sdk.CodeGeneration/Output/ApiDescriptionWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ private static void WriteParameter(CodeGenerationContext context, StringWriter w
336336
break;
337337

338338
case ActionParameterPropertySource property:
339-
writer.Write($"{variableName}.ResolveParameterFromSource(\"{parameterName}\", \"{property.Definition.Name}\", \"{property.PropertyName}\"");
339+
writer.Write($"{variableName}.ResolveParameterFromSource(\"{parameterName}\", \"{property.Definition.Name}\", \"{property.PropertyPath}\"");
340340

341341
if (property.ItemSources.Any())
342342
{

src/Dibix.Sdk.CodeGeneration/Validation/ActionParameterFixedPropertySourceValidator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ internal abstract class ActionParameterFixedPropertySourceValidator<TSource> : A
77
{
88
public override bool Validate(ActionParameter rootParameter, ActionParameterInfo currentParameter, IActionParameterPropertySource currentValue, IActionParameterPropertySource parentValue, ActionDefinition actionDefinition, ISchemaRegistry schemaRegistry, ILogger logger)
99
{
10-
if (Definition.Properties.Any(x => x.Name == currentValue.PropertyName))
10+
if (Definition.Properties.Any(x => x.Name == currentValue.PropertyPath))
1111
return true;
1212

1313
int column = currentValue.Location.Column + Definition.Name.Length + 1; // Skip source name + dot
14-
logger.LogError($"Source '{Definition.Name}' does not support property '{currentValue.PropertyName}'", currentValue.Location.Source, currentValue.Location.Line, column);
14+
logger.LogError($"Source '{Definition.Name}' does not support property '{currentValue.PropertyPath}'", currentValue.Location.Source, currentValue.Location.Line, column);
1515
return false;
1616
}
1717
}

src/Dibix.Sdk.CodeGeneration/Validation/EndpointModelValidator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ private bool ValidateAsyncFileUpload(ActionDefinition action, ActionParameter pa
160160
if (action.Target.IsAsync)
161161
return true;
162162

163-
if (parameter.ParameterSource is not ActionParameterPropertySource { Definition: BodyParameterSource, PropertyName: BodyParameterSource.RawPropertyName } propertySource)
163+
if (parameter.ParameterSource is not ActionParameterPropertySource { Definition: BodyParameterSource, PropertyPath: BodyParameterSource.RawPropertyName } propertySource)
164164
return true;
165165

166166
_logger.LogError($"The parameter '{parameter.InternalParameterName}' accepts a stream, therefore the accessor must be marked with @Async", propertySource.Location);

src/Dibix.Sdk.CodeGeneration/Validation/UserDefinedTypeParameterModelValidator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ private bool ValidateParameter(ActionParameter parameter, ActionDefinition actio
7070
ObjectSchemaProperty sourceProperty = bodyObjectSchema.Properties.SingleOrDefault(x => String.Equals(x.Name, parameter.InternalParameterName, StringComparison.OrdinalIgnoreCase));
7171
ActionParameterPropertySource propertySource = parameter.ParameterSource as ActionParameterPropertySource;
7272
if (sourceProperty == null && propertySource != null)
73-
sourceProperty = bodyObjectSchema.Properties.SingleOrDefault(x => String.Equals(x.Name, propertySource.PropertyName, StringComparison.OrdinalIgnoreCase));
73+
sourceProperty = bodyObjectSchema.Properties.SingleOrDefault(x => String.Equals(x.Name, propertySource.PropertyPath, StringComparison.OrdinalIgnoreCase));
7474

7575
ActionTarget target = action.Target;
7676
if (sourceProperty == null)

src/Dibix.Sdk.CodeGeneration/Validation/ValidationUtility.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ internal static class ValidationUtility
66
{
77
public static bool VerifyPathParameterNotUsedInSource(IActionParameterPropertySource currentValue, ActionDefinition actionDefinition, ActionParameterSourceDefinition sourceDefinition, ILogger logger)
88
{
9-
string sourcePropertyName = currentValue.PropertyName;
9+
string sourcePropertyName = currentValue.PropertyPath;
1010
if (actionDefinition.PathParameters.ContainsKey(sourcePropertyName))
1111
{
1212
SourceLocation location = currentValue.Location;

0 commit comments

Comments
 (0)