diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 2462a1418f6d3653ddca5f1ef9cfe7693851c70c..232bd02149728a1855d88769e830f01c94eff337 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -2231,7 +2231,7 @@ public class DefaultCodegen implements CodegenConfig { * Override with any special handling of response codes * * @param responses OAS Operation's responses - * @return default method response or <tt>null</tt> if not found + * @return default method response or <code>null</code> if not found */ protected ApiResponse findMethodResponse(ApiResponses responses) { String code = null; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/GeneratorNotFoundException.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/GeneratorNotFoundException.java index f01d89cce268413aba7afa3b4104793469b0701d..6554adf8d0aea5df4d1b39b4580044636fb255f8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/GeneratorNotFoundException.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/GeneratorNotFoundException.java @@ -34,7 +34,7 @@ public class GeneratorNotFoundException extends RuntimeException { * @param message the detail message (which is saved for later retrieval * by the {@link #getMessage()} method). * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A <tt>null</tt> value is + * {@link #getCause()} method). (A <code>null</code> value is * permitted, and indicates that the cause is nonexistent or * unknown.) * @since 1.4 @@ -45,13 +45,13 @@ public class GeneratorNotFoundException extends RuntimeException { /** * Constructs a new runtime exception with the specified cause and a - * detail message of <tt>(cause==null ? null : cause.toString())</tt> + * detail message of <code>(cause==null ? null : cause.toString())</code> * (which typically contains the class and detail message of - * <tt>cause</tt>). This constructor is useful for runtime exceptions + * <code>cause</code>). This constructor is useful for runtime exceptions * that are little more than wrappers for other throwables. * * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A <tt>null</tt> value is + * {@link #getCause()} method). (A <code>null</code> value is * permitted, and indicates that the cause is nonexistent or * unknown.) * @since 1.4 diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/SpecValidationException.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/SpecValidationException.java index 1578918ba8c186a75f44b32a4cd2f3b4771a980c..f09ba918cbc8ab33c0c02e2d6575e5aacc7f83d8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/SpecValidationException.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/SpecValidationException.java @@ -36,7 +36,7 @@ public class SpecValidationException extends RuntimeException { * @param message the detail message (which is saved for later retrieval * by the {@link #getMessage()} method). * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A <tt>null</tt> value is + * {@link #getCause()} method). (A <code>null</code> value is * permitted, and indicates that the cause is nonexistent or * unknown.) * @since 1.4 @@ -47,13 +47,13 @@ public class SpecValidationException extends RuntimeException { /** * Constructs a new runtime exception with the specified cause and a - * detail message of <tt>(cause==null ? null : cause.toString())</tt> + * detail message of <code>(cause==null ? null : cause.toString())</code> * (which typically contains the class and detail message of - * <tt>cause</tt>). This constructor is useful for runtime exceptions + * <code>cause</code>). This constructor is useful for runtime exceptions * that are little more than wrappers for other throwables. * * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A <tt>null</tt> value is + * {@link #getCause()} method). (A <code>null</code> value is * permitted, and indicates that the cause is nonexistent or * unknown.) * @since 1.4 diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java index 967fd8357aedd9f46fc1eefa7a5ae7141cf782b1..2019fa208fff6038c9386b125765bd09ca013504 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java @@ -18,6 +18,7 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.media.StringSchema; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.CliOption; @@ -345,9 +346,17 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg if (ModelUtils.isArraySchema(p)) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); + if (inner == null) { + LOGGER.warn(ap.getName() + "(array property) does not have a proper inner type defined.Default to string"); + inner = new StringSchema().description("TODO default missing array inner type to string"); + } return getTypeDeclaration(inner) + "[]"; } else if (ModelUtils.isMapSchema(p)) { Schema inner = ModelUtils.getAdditionalProperties(p); + if (inner == null) { + LOGGER.warn(p.getName() + "(map property) does not have a proper inner type defined. Default to string"); + inner = new StringSchema().description("TODO default missing map inner type to string"); + } return getSchemaType(p) + "[string," + getTypeDeclaration(inner) + "]"; } else if (StringUtils.isNotBlank(p.get$ref())) { // model String type = super.getTypeDeclaration(p);