marshmallow-code / marshmallow-code/flask-smorest

Is it possible to use other objects than json in the request body?

Open
#315 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
717
Forks
77
Avg merge
7h 49m
Merged PRs (30d)
3

Description

Hi,

I am wondering if there is a way to have a list instead of the json object in the request body?
My currect solution with a schema containing a field of type List looks like this:

`{
"id_list": [
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
]
}`

Desired request body schema:
`["3fa85f64-5717-4562-b3fc-2c963f66afa6"]`

Thank you.

Contributor guide

Open the contributing guide

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

Start by investigating how flask-smorest represents request-body schemas and whether OpenAPI permits a top-level array. Compare the current id_list object example with the desired array; done means determining whether list bodies can be supported and documenting or testing the resulting schema and request handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
flask, openapi, python
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.