You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 24, 2025. It is now read-only.
The FormData generation for file uploads has been significantly changed to use Blob objects for JSON metadata. This needs careful validation to ensure proper multipart/form-data encoding and server compatibility.
Multiple test expectations have been updated to match new API responses. The changes in error message formats and cache control headers should be verified against actual API behavior.
expect(err.body.error).toBe('error in openapi3filter.RequestError: request body has an error: doesn\'t match schema: Error at "/file[]": property "file[]" is missing',);
New parameter handling logic has been added to support both schema and content-based parameters. The fallback logic and error handling should be thoroughly tested.
switch {
caseparam.Schema!=nil:
t2, tt, err:=GetType(param.Schema, method+format.Title(param.Name), p, false)
iferr!=nil {
returnnil, nil, fmt.Errorf("failed to get type for parameter %s: %w", param.Name, err)
}
types=append(types, tt...)
t=t2caseparam.Content!=nil:
jsonMediaType, ok:=param.Content.Get("application/json")
if!ok {
returnnil, nil, fmt.Errorf( //nolint:err113"parameter %s in operation %s has no application/json content defined",
param.Name,
operation.OperationId,
)
}
t2, tt, err:=GetType(jsonMediaType.Schema, method+format.Title(param.Name), p, false)
iferr!=nil {
returnnil, nil, fmt.Errorf("failed to get type for parameter %s: %w", param.Name, err)
}
types=append(types, tt...)
t=t2default:
returnnil, nil, fmt.Errorf("parameter %s in operation %s has no schema or content defined", param.Name, operation.OperationId) //nolint:goerr113,lll
}
The empty string as the third parameter to formData.append() creates a Blob without a filename. This may cause issues with some servers that expect a filename for file uploads. Consider providing a meaningful filename or removing the parameter entirely.
Why: The suggestion correctly identifies that the empty string filename parameter is unnecessary when appending a Blob to FormData. Removing it simplifies the code without affecting functionality, as the filename parameter is optional for Blobs.
Low
Remove unnecessary empty filename parameter
The empty string as the third parameter to formData.append() creates a blob with no filename. This could cause issues with server-side parsing that expects proper form field names. Consider omitting the third parameter or providing a meaningful filename.
formData.append(
"metadata[]",
- new Blob([JSON.stringify(value)], { type: "application/json" }),- "",+ new Blob([JSON.stringify(value)], { type: "application/json" })
)
Suggestion importance[1-10]: 4
__
Why: The suggestion correctly identifies that the empty string filename parameter is unnecessary when appending a Blob to FormData. However, this is a minor code style improvement that doesn't affect functionality, as both approaches work correctly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
Enhancement
Description
Update OpenAPI specs to version 0.8.0-beta3
Fix FormData generation for file uploads
Update test expectations for API changes
Add new authentication method descriptions
Diagram Walkthrough
File Walkthrough
6 files
Update test expectations for API changesUpdate error response structure in testsAdd new test data for code generationUpdate FormData generation in test referenceAdd new test case for content processingAdd OAuth provider test specification5 files
Update auth client with new API specsRegenerate storage client from updated specsImprove parameter handling for content typesUpdate auth OpenAPI specificationUpdate storage OpenAPI specification2 files
Update nixops reference to main branchUpdate service versions to 0.8.0-beta12 files
Update auth documentation with new descriptionsUpdate storage documentation with new API2 files
Update dependency versions and security overridesAdd security overrides for dependencies2 files
Fix FormData generation for JSON objectsFix parameter attribute help rendering