Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Exposer paramName dans les templates #350

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TopModel.Core/ModelStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1526,7 +1526,7 @@ IEnumerable<ModelError> ResolveAliases(IEnumerable<AliasProperty> alps)

if (param == null)
{
yield return new ModelError(endpoint, $"Le endpoint '{endpoint.Name}' définit un paramètre '{routeParamName}' dans sa route qui n'existe pas dans la liste des paramètres.") { ModelErrorType = ModelErrorType.TMD1027 };
yield return new ModelError(endpoint, $"Le endpoint '{endpoint.Name}' définit un paramètre '{routeParamName}' dans sa route qui n'existe pas dans la liste des paramètres. Les valeurs possibles sont : {string.Join(", ", endpoint.Params.OfType<IFieldProperty>().Select(p => p.GetParamName()))}.") { ModelErrorType = ModelErrorType.TMD1027 };
}
}
}
Expand Down
1 change: 1 addition & 0 deletions TopModel.Generator.Core/TemplateExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ private static string ResolveVariable(this string input, IFieldProperty fp, stri
{
"name" => transform(fp.Name ?? string.Empty),
"sqlName" => transform(fp.SqlName ?? string.Empty),
"paramName" => transform(fp.GetParamName().ToString()),
"trigram" => transform(fp.Trigram ?? fp.Class?.Trigram ?? string.Empty),
"label" => transform(fp.Label ?? string.Empty),
"comment" => transform(fp.Comment),
Expand Down
Loading