Skip to content

Commit

Permalink
Merge pull request #119 from tochka-public/feature/CSHARP-167
Browse files Browse the repository at this point in the history
fix: allow PropertyNamingPolicy = null
  • Loading branch information
Rast1234 authored Sep 23, 2024
2 parents 0ff7734 + 6eba02d commit 4e81435
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void Apply(ParameterModel parameter)
foreach (var actionSelector in parameter.Action.Selectors)
{
var jsonSerializerOptions = ServerUtils.GetDataJsonSerializerOptions(actionSelector.EndpointMetadata, options, serializerOptionsProviders);
var propertyName = jsonSerializerOptions.PropertyNamingPolicy!.ConvertName(parameter.ParameterName);
var propertyName = jsonSerializerOptions.ConvertName(parameter.ParameterName);
var parametersMetadata = actionSelector.EndpointMetadata.Get<JsonRpcActionParametersMetadata>();
if (parametersMetadata == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ private string GetMethodName(ActionModel action, SelectorModel selector)
var methodStyleAttribute = selector.EndpointMetadata.Get<JsonRpcMethodStyleAttribute>();
var methodStyle = methodStyleAttribute?.MethodStyle ?? options.DefaultMethodStyle;

var controllerName = jsonSerializerOptions.PropertyNamingPolicy!.ConvertName(action.Controller.ControllerName);
var actionName = jsonSerializerOptions.PropertyNamingPolicy.ConvertName(action.ActionName);
var controllerName = jsonSerializerOptions.ConvertName(action.Controller.ControllerName);
var actionName = jsonSerializerOptions.ConvertName(action.ActionName);
return methodStyle switch
{
JsonRpcMethodStyle.ControllerAndAction => $"{controllerName}{JsonRpcConstants.ControllerMethodSeparator}{actionName}",
Expand Down

0 comments on commit 4e81435

Please sign in to comment.