none
Swagger seems have some problem RRS feed

  • Question

  • I used swagger to auto-generated C# codes (on swagger.io). in the User API part, this function:

     public ApiResponse< AccessTokenResponse > RevokeRefreshTokenWithHttpInfo (string refreshToken)
            {
                // verify the required parameter 'refreshToken' is set


    seems has problem, because the refreshToken should be a query parameter instead of path parameter.

    I need to change the following:

                //var localVarPath = "/login/refreshToken/{refreshToken}"; 
                // above was generated by Swagger, below is my manual fix
                var localVarPath = "/login/refreshToken";


    and this part:

                // set "format" to json by default
                // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
                //localVarPathParams.Add("format", "json"); // this was generated by Swagger, I commented it out.
                if (refreshToken != null) localVarQueryParams.Add("refreshToken", Configuration.ApiClient.ParameterToString(refreshToken)); // path parameter  // Swagger sets the "PathParams" but it really should be Query params.
    

    After the manual fix it works. So i'm wondering if this is a bug that should be fixed on your side.

    I'm using MRS 9.0.1 on Windows platform

    Wednesday, June 7, 2017 6:24 PM

All replies

  • Hi,

    I am from the product team, thank you for reporting this.

    This will be fixed in the next MRS version (9.2)

    Wednesday, June 14, 2017 4:58 PM