Base solution for your next web application
Open Closed

Input parmater always null #3179


User avatar
0
faweh created

Hi, I made this AppService, having a get function, but when i test the service from Swagger the input Id paramter is always null. please why is that happening?

below is an example

//input dto
    public class GetRuleInput
    {
        public string Id { get; set; }
    }

//interface
    public interface ILoyaltyAppService : IApplicationService
    {
        Task<JObject> GetRule(GetRuleInput input);
    }

//service
     public async Task<JObject> GetRule(GetRuleInput input) {
                var result = await _maClient.GetSingleRuleAsync(input.Id);

                var response = JObject.FromObject(result);

                return response;
        }

3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @faweh,

    I will test this to reproduce your problem. Does this work from UI ?

  • User Avatar
    0
    marble68 created

    I also have this issue.

    I'm sure I'm missing a basic step.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @marble68,

    Do you use ASP.NET MVC or ASP.NET Core ? Also, which version of swashbuckle do you use ?

    Thanks.