Bug Report Checklist
Description
When enabling generateConstructorWithAllArgs @Nullable annotations are not generated for the parameters of the all args constructor:
public class GetFoo200Response {
public static final String JSON_PROPERTY_FOO = "foo";
private String foo;
public static final String JSON_PROPERTY_BAR = "bar";
private JsonNullable<String> bar = JsonNullable.<String>undefined();
public static final String JSON_PROPERTY_BAZ = "baz";
private @Nullable String baz;
public GetFoo200Response() {
}
/**
* Constructor with all args parameters
*/
public GetFoo200Response(@JsonProperty(JSON_PROPERTY_FOO) String foo, @JsonProperty(JSON_PROPERTY_BAR) String bar, @JsonProperty(JSON_PROPERTY_BAZ) String baz) {
this.foo = foo;
this.bar = bar == null ? JsonNullable.<String>undefined() : JsonNullable.of(bar);
this.baz = baz;
}
// remaining code ommitted
}
The baz field is marked as nullable, but not the baz parameter on the constructor.
openapi-generator version
7.23.0
OpenAPI declaration file content or url
openapi: "3.0.2"
info:
title: Foo API
version: 1.0.0
paths:
/foo:
get:
operationId: getFoo
responses:
'200':
description: ""
content:
application/json:
schema:
type: object
properties:
foo:
type: string
bar:
type: string
nullable: true
baz:
type: string
nullable: true
required:
- foo
- baz
Generation Details
Used config:
<configOptions>
<dateLibrary>java8</dateLibrary>
<library>webclient</library>
<useJakartaEe>true</useJakartaEe>
<useSpringBoot4>true</useSpringBoot4>
<useJackson3>true</useJackson3>
<useJspecify>true</useJspecify>
<generateConstructorWithAllArgs>true</generateConstructorWithAllArgs>
</configOptions>
Steps to reproduce
Related issues/PRs
Suggest a fix
The @Nullable annotations probably need to be added to the constructor in pojo.mustache
Bug Report Checklist
Description
When enabling
generateConstructorWithAllArgs@Nullableannotations are not generated for the parameters of the all args constructor:The
bazfield is marked as nullable, but not thebazparameter on the constructor.openapi-generator version
7.23.0
OpenAPI declaration file content or url
Generation Details
Used config:
Steps to reproduce
Related issues/PRs
Suggest a fix
The
@Nullableannotations probably need to be added to the constructor in pojo.mustache