effect icon indicating copy to clipboard operation
effect copied to clipboard

`nullable: true` is not part of OpenAPI 3.1

Open SemStassen opened this issue 6 months ago • 0 comments

What is the problem this feature would solve?

I recently looked into generating SDK's from my HttpApiBuilder API specification.

During that process I notices a small mismatch between the generated OpenApi Spec from OpenApi.fromApi and the OpenApi spec as specified on their website.

Mainly:

Generated properties than can be null should be generated as

title: {
type: ["string", "null"]
}

instead of

title: {
type: "string",
nullable: true
}

See this discussion for further clarification.

I am willing to look into this myself too when I find the time!

What is the feature you are proposing to solve the problem?

Generating properties as:


title: {
type: ["string", "null"]
}

instead of

title: {
type: "string",
nullable: true
}

when they can be null

What alternatives have you considered?

My "quickfix" is writing a simple script that does this conversion for me

SemStassen avatar Jun 20 '25 06:06 SemStassen