[documentcollector] Code generation: update services and models - #591
[documentcollector] Code generation: update services and models#591AdyenAutomationBot wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the generated documentcollector package for the Cross-border Invoices API, including API client code, document upload endpoints, and related models. However, critical issues were identified in the generated code: the DocumentContext type is undefined, which will cause compilation failures, and the UploadCrossBorderInvoice function completely ignores its input parameters (such as the file and merchant account), rendering the API call non-functional.
|
|
||
| // All parameters accepted by DocumentsApi.UploadCrossBorderInvoice | ||
| type DocumentsApiUploadCrossBorderInvoiceInput struct { | ||
| context *DocumentContext |
There was a problem hiding this comment.
The type DocumentContext is not defined anywhere in the documentcollector package, nor is it imported. This will cause a compilation error (undefined: DocumentContext). Please verify if the model definition for DocumentContext is missing from the OpenAPI specification or if the generator skipped generating it.
| func (a *DocumentsApi) UploadCrossBorderInvoice(ctx context.Context, r DocumentsApiUploadCrossBorderInvoiceInput) (DocumentUploadResponse, *http.Response, error) { | ||
| res := &DocumentUploadResponse{} | ||
| path := "/crossBorderInvoices" | ||
| queryParams := url.Values{} | ||
| headerParams := make(map[string]string) | ||
| httpRes, err := common.SendAPIRequest( | ||
| ctx, | ||
| a.Client, | ||
| nil, | ||
| res, | ||
| http.MethodPost, | ||
| a.BasePath()+path, | ||
| queryParams, | ||
| headerParams, | ||
| ) | ||
|
|
||
| return *res, httpRes, err | ||
| } |
There was a problem hiding this comment.
The input parameters r.file, r.merchantAccount, and r.context are completely ignored in the UploadCrossBorderInvoice function. The request is sent with a nil body and empty query/header parameters, which makes the API call non-functional (the file is never uploaded). This is likely a code generation issue where multipart form-data or request body mapping is missing in the generator templates or OpenAPI spec.
dcea7cb to
ac261bf
Compare
fc33661 to
e860719
Compare
e860719 to
2a3e76d
Compare
This PR contains the automated changes for the
documentcollectorservice.The commit history of this PR reflects the
adyen-openapicommits that have been applied.