diff --git a/modules/openapi-generator/src/main/resources/php-symfony/model_variables.mustache b/modules/openapi-generator/src/main/resources/php-symfony/model_variables.mustache
index 38959f360eb2f11838b0643752a4f7f21799c789..e6bb7ea9a594cc580e124b9f8893a2b8bab89aa0 100644
--- a/modules/openapi-generator/src/main/resources/php-symfony/model_variables.mustache
+++ b/modules/openapi-generator/src/main/resources/php-symfony/model_variables.mustache
@@ -7,6 +7,9 @@
      * @SerializedName("{{baseName}}")
 {{#required}}
      * @Assert\NotNull()
+     {{^isPrimitiveType}}
+     * @Assert\Valid()
+     {{/isPrimitiveType}}
 {{/required}}
 {{#isEnum}}
     {{#isContainer}}