OpenAPITools / OpenAPITools/jackson-databind-nullable

The openapi swagger codegen generates JsonNullable type fields if the type attribute in swagger is not mentioned. How to overcome this without modifying the swagger. I want JsonNullable for other fields except few.

Open
#57 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
153
Forks
47
Avg merge
4d 15h
Merged PRs (30d)
6

Description

The openapi swagger codegen generates JsonNullable type fields if the type attribute in swagger is not mentioned. How to overcome this without modifying the swagger. I want JsonNullable for other fields except few.

Sample Swagger:
openapi: 3.0.3
components:
schemas:
Filter:
required:
- name
- value
type: object
properties:
name:
title: Name
type: string
value:
title: Value

In the above sample swagger, the value field is generated as JsonNullable. But i want it to be created as Object type. How to handle this without changing the swagger. Also i dont want to disable JsonNullable for entire swagger. is there a way to achieve this?

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

Start with the sample OpenAPI Filter schema and the code-generation behavior described in the issue. Check whether the project exposes a per-field override for omitted property types while preserving JsonNullable elsewhere; done means documenting or identifying a supported way to generate value as Object without changing the schema or disabling JsonNullable globally.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.