mia-platform / mia-platform/custom-plugin-lib

Issue on validation when exposing a multipart/form-data API

Open
#347 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
25
Forks
7
PR merge metrics
No merged PRs in 30d

Description

## The feauture or bug you are proposing
Issue on validating a `multipart/form-data` request

## The description of the bug or the rationale of your proposal
The schema definition of a `mutlipart/form-data` part requires the following body structure:
```
{
additionalProperties: false,
properties: {
part: {
description: 'Binary content of the file to upload',
format: 'binary',
type: 'string',
},
},
required: ['part'],
type: 'object',
}
```
Calling the endpoint with a binary file uploaded through the `part` field does return a validation error which states: 'body.part must be string`

## The expected result for your bug
I expect that this validation error should not happen

### Your environment

node: 8.15.0

custom-plugin-lib: 4.3.2

os: 20.04.5 LTS (Focal Fossa), Ubuntu

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the multipart/form-data endpoint using the schema shown in the issue, uploading binary content through the part field. Trace the validation path for that request and verify the fix by confirming it no longer reports that body.part must be a string.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.