swagger-api / swagger-api/swagger-core

oneOf field in @Schema accept 'null' value

Open
#4,395 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backlog
Dominant language
Java
Stars
7.5k
Forks
2.3k
Avg merge
18h 1m
Merged PRs (30d)
10

Description

Hi everyone

May I ask are the 'oneOf' field could could accepts 'null' value and generates OAS Specification file like below?
image

If possible, please tell me how to achieve it.

Thanks!

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

The issue names the Java @Schema annotation and an OpenAPI Specification output; start by tracing how oneOf is represented in generated output and check whether null is supported. Compare the result with the OAS example shown in the issue, then define the expected output before deciding whether documentation or a code change is needed.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.