Skip to content

Commit

Permalink
fix: allow PropertyNamingPolicy = null
Browse files Browse the repository at this point in the history
  • Loading branch information
Говорухин Александр committed Sep 19, 2024
1 parent d8d0c5c commit 6eba02d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 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
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ private static void ValidMethod()
{
}

private class ValidJsonRpcController : JsonRpcControllerBase
private sealed class ValidJsonRpcController : JsonRpcControllerBase
{
public void ValidJsonRpcMethod()
{
Expand Down

0 comments on commit 6eba02d

Please sign in to comment.