Base solution for your next web application
Open Closed

Application Service APIs are not shown with Swagger UI #10589


User avatar
0
shridhar.mole created

Hello,

I am creating a new Application Service class derived from GrowthPlanServiceBase class but the public methods are not seen in Swagger UI page. The API Urls when called from Postman return 404 as well. This was working before as I have added new App Service classes in the past.

Can you please let me know if I am missing something?

Thanks in advance.


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

    Hi,

    Could you share your app service and its interface definitions ?

    Thanks,

  • User Avatar
    0
    shridhar.mole created

    Hi,

    Following are the App Service and Interface definitions

    [AbpAuthorize(AppPermissions.Pages_Tenant_ManageBudgetVersions)]
    public class BudgetVersionsAppService : GrowthPlanServiceBase, IBudgetVersionsAppService
    {
        private readonly IRepository<BudgetVersion, long> _budgetVersionRepository;
    
        public BudgetVersionsAppService(IRepository<BudgetVersion, long> budgetVersionRepository)
        {
            _budgetVersionRepository = budgetVersionRepository;
        }
    
        [HttpPut]
        public async Task UpdateBudgetVersion([FromBody] BudgetVersionDto input, [FromQuery] string newName)
        {
    
        }
    
        public async Task<PagedResultDto<BudgetVersionDto>> GetBudgetVersions(GetBudgetVersionInput input)
        {
    
        }
    }
    
    public interface IBudgetVersionsAppService
    {
        public Task UpdateBudgetVersion(BudgetVersionDto input, string newName);
        public Task<PagedResultDto<BudgetVersionDto>> GetBudgetVersions(GetBudgetVersionInput input);
    }
    

    Thanks.

  • User Avatar
    0
    rvanwoezik created

    Please try this:

    public interface IBudgetVersionsAppService : IApplicationService
    {
        public Task UpdateBudgetVersion(BudgetVersionDto input, string newName);
        public Task<PagedResultDto<BudgetVersionDto>> GetBudgetVersions(GetBudgetVersionInput input);
    }
    

    Kind regards, Rene

  • User Avatar
    0
    shridhar.mole created

    Hi @rvanwoezik

    This change solved the issue. Thank you so much !