Acumatica / AcumaticaRESTAPIClientForCSharp

MIT License
27 stars 15 forks source link

ApiClient Calls not respecting top or skip. #43

Closed jeremy-schaab closed 1 year ago

jeremy-schaab commented 1 year ago

I noticed that the API is not using the top or skip values in the ComponseQueryParams. When I tested just the CallApiAsync and added those values to the ComposeQueryParams method, top worked perfectly. Here as the code from the Implemented API, you can see that skip or top never make it anywhere.

   protected async Task<ApiResponse<List<EntityType>>> GetListAsyncWithHttpInfo(
        string select = null, string filter = null, string expand = null, string custom = null,
        int? skip = null, int? top = null, Dictionary<string, string> customHeaders = null)
    {
        HttpResponseMessage localVarResponse = await ApiClient.CallApiAsync(
            $"{GetEndpointPath()}/{GetEntityName()}",
            HttpMethod.Get,
            ComposeQueryParams(select, filter, expand, custom),
            null,
            HeaderContentType.Json,
            HeaderContentType.None,
            customHeaders);

        VerifyResponse(localVarResponse, "GetList");

        return DeserializeResponse<List<EntityType>>(localVarResponse);
    }
Dmitrii-Naumov commented 1 year ago

@jeremy-schaab Thanks for reporting. That's already fixed in the 5.0 branch: https://github.com/Acumatica/AcumaticaRESTAPIClientForCSharp/blob/5.0/Acumatica.RESTClient.ContractBasedApi/ApiClientExtensions.cs#L457

JudahMorrison commented 9 months ago

How long before the 5.0 branch will be deployed? It has been in its alpha stage for 5 months. image

dnaumov commented 9 months ago

There are still some issues with Async/sync methods in 5.0, need to fix that. Was going to do that in January