Skip to content

Unable to pass errorMapping to send methods in requestBuilder #120

Description

@maxrichter-dyna

The generated requestBuilder always passes an empty map to the requestAdapter for the errorMapping:

Future<Post?> postAsync(Post body, [void Function(RequestConfiguration<DefaultQueryParameters>)? requestConfiguration]) async {
        var requestInfo = toPostRequestInformation(body, requestConfiguration);
        return await requestAdapter.send<Post>(requestInfo, Post.createFromDiscriminatorValue, {});
                                                                                             /* ↑ errorMapping */
}

The default HttpClientRequestAdapter could handle the errorMapping, but a missing errorMapping will always cause an ApiException to be thrown, which has to be handled with a trycatch block.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions