Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow job creation without requiring multipart/form-data #30429

Open
bryanboza opened this issue Oct 22, 2024 · 0 comments
Open

Allow job creation without requiring multipart/form-data #30429

bryanboza opened this issue Oct 22, 2024 · 0 comments

Comments

@bryanboza
Copy link
Member

bryanboza commented Oct 22, 2024

Parent Issue

Related to #29480

Problem Statement

Currently, creating a new job in the system requires a multipart/form-data request, even when no files are being uploaded. If an application/json request is sent without the multipart form, it fails. This is an unnecessary limitation as users should be able to create jobs by simply sending a regular JSON payload with the necessary information, without having to include multipart data unless file uploads are involved. This affects users who are creating jobs programmatically and do not need to upload files, causing avoidable failures and extra complexity.
image

Steps to Reproduce

  • Attempt to create a new job via the API. {{baseUrl}}/api/v1/jobs/{{queueName}}

  • Send a POST request with the Content-Type: application/json and a JSON payload containing all the necessary job details.

  • Observe that the request fails unless multipart/form-data is used, even though no file is being uploaded.

Acceptance Criteria

  • Job creation should be allowed with application/json requests when no file uploads are involved.
  • The system should only require multipart/form-data when files are being sent as part of the job creation request.
  • The API should successfully handle job creation when only a JSON payload is provided with the necessary job details.
  • Ensure backward compatibility, so that multipart/form-data can still be used when files need to be uploaded.

dotCMS Version

Tested on trunk // Docker

Proposed Objective

Quality Assurance

Proposed Priority

Priority 2 - Important

Quality Assurance Notes & Workarounds

  • Ensure job creation works correctly with both multipart/form-data and application/json depending on whether files are included in the request.
  • Test creating jobs with and without file uploads to confirm that the appropriate request type works in each scenario.
  • Until this issue is resolved, users need to continue using multipart/form-data for job creation, even if they are not uploading files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: New
Development

No branches or pull requests

1 participant