Implement multipart/form-data upload for counter reports
Description
Currently, the process of uploading counter reports in different formats (JSON, XML, CSV) relies on encoding the report data as a base64 string and sending it alongside metadata in JSON format. However, this approach presents limitations, particularly when the report data is extensive, potentially exceeding the string length limit of the Jackson JSON library - https://folio-org.atlassian.net/browse/MODEUS-170.
To address this issue and enhance the efficiency of report uploads, I propose implementing the upload via multipart/form-data MIME type. This approach would enable the separation of metadata, transmitted as text, from the report data, transmitted in binary format. This bypasses any string length limitations of the Jackson JSON library.
Proposed Solution:
Add an additional endpoint that supports multipart/form-data MIME type to upload reports alongside with metadata
Separate metadata from the report data, transmitting metadata as text fields and the report data in binary format.
Keep the old endpoint to ensure backward compatibility until a new major release is planned.
Implement necessary changes in UI as well.
Acceptance Criteria:
The system should successfully accept multipart requests for uploading counter reports.
Metadata should be transmitted as text fields, while the report data should be transmitted in binary format.
Uploaded reports should be correctly processed and stored on the server.
Unit tests should be implemented to verify the functionality of multipart upload support.
Currently, the process of uploading counter reports in different formats (JSON, XML, CSV) relies on encoding the report data as a base64 string and sending it alongside metadata in JSON format. However, this approach presents limitations, particularly when the report data is extensive, potentially exceeding the string length limit of the Jackson JSON library - https://folio-org.atlassian.net/browse/MODEUS-170.
To address this issue and enhance the efficiency of report uploads, I propose implementing the upload via
multipart/form-data
MIME type. This approach would enable the separation of metadata, transmitted as text, from the report data, transmitted in binary format. This bypasses any string length limitations of the Jackson JSON library.Proposed Solution:
Add an additional endpoint that supports
multipart/form-data
MIME type to upload reports alongside with metadataSeparate metadata from the report data, transmitting metadata as text fields and the report data in binary format.
Keep the old endpoint to ensure backward compatibility until a new major release is planned.
Implement necessary changes in UI as well.
Acceptance Criteria:
The system should successfully accept multipart requests for uploading counter reports.
Metadata should be transmitted as text fields, while the report data should be transmitted in binary format.
Uploaded reports should be correctly processed and stored on the server.
Unit tests should be implemented to verify the functionality of multipart upload support.