swagger-api / swagger-api/swagger-core

Schema generation fails when using `OptionalInt` as type for a field

Open
#4,717 0 comments 1 reaction 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

It has been already mentioned here. And indeed I've encountered same problem and can confirm that AnnotatedType coming to the ModelResolver.resolve() method is returning null for a type.

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 inspecting ModelResolver.resolve() and the AnnotatedType handling described in the issue, then trace how OptionalInt reaches schema generation. Confirm the failure and determine what should happen when the incoming type is null; done means schema generation succeeds for a field typed as OptionalInt.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.