swagger-api / swagger-api/swagger-ui

Configuration option to change default "send empty value" to true in form data

Open
#6,505 15 comments 23 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Hacktoberfest type: feature
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Hello,
In my API, I have some multipart forms, here's a screenshot from the pet store:
image

I want to have these checkboxes unchecked by default, because of the way my API deals with empty form fields.
So far, I've tried to modify the request-body and the parameter-include-empty components by writing a plug-in, but I'm struggling to have the parameter-include-empty unchecked (by setting isIncluded to false) without breaking the behaviour of request-body.
Is the current version of swagger-ui allowing for this customization?
Sorry for my poor skills in react, any help is welcome!

Related links:
#5830 Allow to skip submitting empty values in form data
#6228 Set default true for 'send empty value'

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 reading the related pull requests #5830 and #6228, then inspect the parameter-include-empty and request-body components mentioned in the issue. Determine how a configuration option could set the empty-value control unchecked by default without changing request-body behavior. Done means the option is supported and its default behavior is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.