Skip to content

Refactor CommandesAPI to return response and add error handling#4

Closed
WillyReyno wants to merge 3 commits intoHelloAsso:mainfrom
WillyReyno:patch-1
Closed

Refactor CommandesAPI to return response and add error handling#4
WillyReyno wants to merge 3 commits intoHelloAsso:mainfrom
WillyReyno:patch-1

Conversation

@WillyReyno
Copy link

Took inspiration from PaiementsAPI to complete what was missing here. See #1

There's still an issue with with_details param which is set to boolean and then serialized as an int from the following code:

        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $with_details,
            'withDetails', // param base name
            'boolean', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);

The API returns the following error

{"errors":{"withDetails":["The value '1' is not valid."]}

Workaround is to force "true" or "false" as string in organizationsOrganizationSlugFormsFormTypeFormSlugItemsGet

Took inspiration from PaiementsAPI to complete what was missing here
Updated return type annotation for the method organizationsOrganizationSlugFormsFormTypeFormSlugItemsGet.
@WillyReyno
Copy link
Author

I'm closing this pull request for now as I found more and more missing data from the endpoint which makes it nearly unusable. I will open an issue with a comparison.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant