Closed S-Panta closed 11 months ago
The problem here is if the server returns a 200
response but the content is not JSON decodeble e.g. in https://github.com/owncloud/libre-graph-api-php/blob/main/lib/Api/MeDrivesApi.php#L203
json_decode
returns null
in that case and that is propagated upwards
should be fixed by https://github.com/OpenAPITools/openapi-generator/pull/16879
@S-Panta please retest, and check if the issue is fixed
Somehow, the body of the response
of listAllDrivesWithHttpInfo()
function is giving html as body response when the wrong format of URL is provided. Json can't decode that response body and it returns null as it's output. I am not if the issue is fixed. It stills give back null response.
@S-Panta exactly and in the current version of this library (after https://github.com/OpenAPITools/openapi-generator/pull/16879) the function should not return null
but throw an JsonException
when it cannot decode the output.
Do you run the most recent version of this library? Please check your package.json , what version of libre-graph-api-php
are you using? maybe rerun composer update
?
I used the latest generation and the response is still Null
.
I used the latest generation and the response is still
Null
.
The current image doesn't include fixed PR. I made bump PR : https://github.com/owncloud/libre-graph-api/pull/143 After this Pr merge you can try
The bump did not do anything, it did not produce any different output
the issue was that we haven't applied the fix of https://github.com/OpenAPITools/openapi-generator/pull/17120 in the template used in the generator, should be done by https://github.com/owncloud/libre-graph-api/pull/146
@S-Panta please confirm if the issue is really fixed
It is fixed.
If the URL is in the wrong format,
response
would benull
and this function doesn't throw any exception but returnsnull
.response
asnull
makes no sense. Thus the function should handle this exception.Note: I have used
[ocis-php-sdk]
to reproduce the error. https://github.com/owncloud/ocis-php-sdkSteps to reproduce
Create an Ocis object using the service Url with an extra slash in it and an access token.
The response will be returned as
null
.Expected result
The function should handle the error.