mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-20 05:57:12 +00:00
Issue 20804: Add java nullability annotations (#20806)
* issue-20804: Add nullability annotations to Java generated clients Motivation: Be able to use generated clients in code checked by tools like NullAway. * issue-20804: Add nullability annotations to Java generated clients Motivation: Be able to use generated clients in code checked by tools like NullAway. * issue-20804: Add nullability annotations to Java generated clients Motivation: Be able to use generated clients in code checked by tools like NullAway.
This commit is contained in:
@@ -81,7 +81,7 @@ public class BodyApi {
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testBodyApplicationOctetstreamBinary(File body) throws ApiException {
|
||||
public String testBodyApplicationOctetstreamBinary(@javax.annotation.Nullable File body) throws ApiException {
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
@@ -119,7 +119,7 @@ public class BodyApi {
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testBodyMultipartFormdataArrayOfBinary(List<File> files) throws ApiException {
|
||||
public String testBodyMultipartFormdataArrayOfBinary(@javax.annotation.Nonnull List<File> files) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'files' is set
|
||||
@@ -164,7 +164,7 @@ public class BodyApi {
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testBodyMultipartFormdataSingleBinary(File myFile) throws ApiException {
|
||||
public String testBodyMultipartFormdataSingleBinary(@javax.annotation.Nullable File myFile) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
@@ -204,7 +204,7 @@ public class BodyApi {
|
||||
* @return a {@code Pet}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Pet testEchoBodyAllOfPet(Pet pet) throws ApiException {
|
||||
public Pet testEchoBodyAllOfPet(@javax.annotation.Nullable Pet pet) throws ApiException {
|
||||
Object localVarPostBody = pet;
|
||||
|
||||
// create path and map variables
|
||||
@@ -242,7 +242,7 @@ public class BodyApi {
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testEchoBodyFreeFormObjectResponseString(Object body) throws ApiException {
|
||||
public String testEchoBodyFreeFormObjectResponseString(@javax.annotation.Nullable Object body) throws ApiException {
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
@@ -280,7 +280,7 @@ public class BodyApi {
|
||||
* @return a {@code Pet}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Pet testEchoBodyPet(Pet pet) throws ApiException {
|
||||
public Pet testEchoBodyPet(@javax.annotation.Nullable Pet pet) throws ApiException {
|
||||
Object localVarPostBody = pet;
|
||||
|
||||
// create path and map variables
|
||||
@@ -318,7 +318,7 @@ public class BodyApi {
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testEchoBodyPetResponseString(Pet pet) throws ApiException {
|
||||
public String testEchoBodyPetResponseString(@javax.annotation.Nullable Pet pet) throws ApiException {
|
||||
Object localVarPostBody = pet;
|
||||
|
||||
// create path and map variables
|
||||
@@ -356,7 +356,7 @@ public class BodyApi {
|
||||
* @return a {@code StringEnumRef}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public StringEnumRef testEchoBodyStringEnum(String body) throws ApiException {
|
||||
public StringEnumRef testEchoBodyStringEnum(@javax.annotation.Nullable String body) throws ApiException {
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
@@ -394,7 +394,7 @@ public class BodyApi {
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testEchoBodyTagResponseString(Tag tag) throws ApiException {
|
||||
public String testEchoBodyTagResponseString(@javax.annotation.Nullable Tag tag) throws ApiException {
|
||||
Object localVarPostBody = tag;
|
||||
|
||||
// create path and map variables
|
||||
|
||||
@@ -43,7 +43,7 @@ public class FormApi {
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testFormIntegerBooleanString(Integer integerForm, Boolean booleanForm, String stringForm) throws ApiException {
|
||||
public String testFormIntegerBooleanString(@javax.annotation.Nullable Integer integerForm, @javax.annotation.Nullable Boolean booleanForm, @javax.annotation.Nullable String stringForm) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
@@ -87,7 +87,7 @@ if (stringForm != null)
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testFormObjectMultipart(TestFormObjectMultipartRequestMarker marker) throws ApiException {
|
||||
public String testFormObjectMultipart(@javax.annotation.Nonnull TestFormObjectMultipartRequestMarker marker) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'marker' is set
|
||||
@@ -137,7 +137,7 @@ if (stringForm != null)
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testFormOneof(String form1, Integer form2, String form3, Boolean form4, Long id, String name) throws ApiException {
|
||||
public String testFormOneof(@javax.annotation.Nullable String form1, @javax.annotation.Nullable Integer form2, @javax.annotation.Nullable String form3, @javax.annotation.Nullable Boolean form4, @javax.annotation.Nullable Long id, @javax.annotation.Nullable String name) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
|
||||
@@ -45,7 +45,7 @@ public class HeaderApi {
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testHeaderIntegerBooleanStringEnums(Integer integerHeader, Boolean booleanHeader, String stringHeader, String enumNonrefStringHeader, StringEnumRef enumRefStringHeader) throws ApiException {
|
||||
public String testHeaderIntegerBooleanStringEnums(@javax.annotation.Nullable Integer integerHeader, @javax.annotation.Nullable Boolean booleanHeader, @javax.annotation.Nullable String stringHeader, @javax.annotation.Nullable String enumNonrefStringHeader, @javax.annotation.Nullable StringEnumRef enumRefStringHeader) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
|
||||
@@ -44,7 +44,7 @@ public class PathApi {
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(String pathString, Integer pathInteger, String enumNonrefStringPath, StringEnumRef enumRefStringPath) throws ApiException {
|
||||
public String testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(@javax.annotation.Nonnull String pathString, @javax.annotation.Nonnull Integer pathInteger, @javax.annotation.Nonnull String enumNonrefStringPath, @javax.annotation.Nonnull StringEnumRef enumRefStringPath) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'pathString' is set
|
||||
|
||||
@@ -48,7 +48,7 @@ public class QueryApi {
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testEnumRefString(String enumNonrefStringQuery, StringEnumRef enumRefStringQuery) throws ApiException {
|
||||
public String testEnumRefString(@javax.annotation.Nullable String enumNonrefStringQuery, @javax.annotation.Nullable StringEnumRef enumRefStringQuery) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
@@ -90,7 +90,7 @@ public class QueryApi {
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testQueryDatetimeDateString(OffsetDateTime datetimeQuery, LocalDate dateQuery, String stringQuery) throws ApiException {
|
||||
public String testQueryDatetimeDateString(@javax.annotation.Nullable OffsetDateTime datetimeQuery, @javax.annotation.Nullable LocalDate dateQuery, @javax.annotation.Nullable String stringQuery) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
@@ -133,7 +133,7 @@ public class QueryApi {
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testQueryIntegerBooleanString(Integer integerQuery, Boolean booleanQuery, String stringQuery) throws ApiException {
|
||||
public String testQueryIntegerBooleanString(@javax.annotation.Nullable Integer integerQuery, @javax.annotation.Nullable Boolean booleanQuery, @javax.annotation.Nullable String stringQuery) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
@@ -174,7 +174,7 @@ public class QueryApi {
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testQueryStyleDeepObjectExplodeTrueObject(Pet queryObject) throws ApiException {
|
||||
public String testQueryStyleDeepObjectExplodeTrueObject(@javax.annotation.Nullable Pet queryObject) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
@@ -213,7 +213,7 @@ public class QueryApi {
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testQueryStyleDeepObjectExplodeTrueObjectAllOf(TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter queryObject) throws ApiException {
|
||||
public String testQueryStyleDeepObjectExplodeTrueObjectAllOf(@javax.annotation.Nullable TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter queryObject) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
@@ -252,7 +252,7 @@ public class QueryApi {
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testQueryStyleFormExplodeFalseArrayInteger(List<Integer> queryObject) throws ApiException {
|
||||
public String testQueryStyleFormExplodeFalseArrayInteger(@javax.annotation.Nullable List<Integer> queryObject) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
@@ -291,7 +291,7 @@ public class QueryApi {
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testQueryStyleFormExplodeFalseArrayString(List<String> queryObject) throws ApiException {
|
||||
public String testQueryStyleFormExplodeFalseArrayString(@javax.annotation.Nullable List<String> queryObject) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
@@ -330,7 +330,7 @@ public class QueryApi {
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testQueryStyleFormExplodeTrueArrayString(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject) throws ApiException {
|
||||
public String testQueryStyleFormExplodeTrueArrayString(@javax.annotation.Nullable TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
@@ -369,7 +369,7 @@ public class QueryApi {
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testQueryStyleFormExplodeTrueObject(Pet queryObject) throws ApiException {
|
||||
public String testQueryStyleFormExplodeTrueObject(@javax.annotation.Nullable Pet queryObject) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
@@ -408,7 +408,7 @@ public class QueryApi {
|
||||
* @return a {@code String}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testQueryStyleFormExplodeTrueObjectAllOf(DataQuery queryObject) throws ApiException {
|
||||
public String testQueryStyleFormExplodeTrueObjectAllOf(@javax.annotation.Nullable DataQuery queryObject) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
|
||||
Reference in New Issue
Block a user