Skip to content

Commit 4690460

Browse files
committed
fix: required
1 parent 70b0e93 commit 4690460

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

templates/cli/lib/type-generation/languages/kotlin.js.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Kotlin extends LanguageMeta {
3030
if (attribute.array) {
3131
type = "List<" + type + ">";
3232
}
33-
if (attribute.required) {
33+
if (!attribute.required) {
3434
type += "?";
3535
}
3636
return type;

templates/cli/lib/type-generation/languages/php.js.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class PHP extends LanguageMeta {
3030
default:
3131
throw new Error(`Unknown attribute type: ${attribute.type}`);
3232
}
33-
if (attribute.required) {
33+
if (!attribute.required) {
3434
type += "|null";
3535
}
3636
return type;

templates/cli/lib/type-generation/languages/swift.js.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Swift extends LanguageMeta {
3030
if (attribute.array) {
3131
type = "[" + type + "]";
3232
}
33-
if (attribute.required) {
33+
if (!attribute.required) {
3434
type += "?";
3535
}
3636
return type;

templates/cli/lib/type-generation/languages/typescript.js.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class TypeScript extends LanguageMeta {
3535
if (attribute.array) {
3636
type += "[]";
3737
}
38-
if (attribute.required) {
38+
if (!attribute.required) {
3939
type += " | null";
4040
}
4141
return type;

0 commit comments

Comments
 (0)