Skip to content

Commit

Permalink
Add nullable values for nullable types (#1327)
Browse files Browse the repository at this point in the history
  • Loading branch information
jillingk authored Feb 20, 2024
1 parent 82cd9fa commit 1b035fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/typescript/model.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{
* {{{.}}}
*/
{{/description}}
'{{name}}'{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}};
'{{name}}'{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}} | null{{/isNullable}};
{{/vars}}

{{#discriminator}}
Expand All @@ -34,7 +34,7 @@ export class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{
{
"name": "{{name}}",
"baseName": "{{baseName}}",
"type": "{{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}"
"type": "{{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}} | null{{/isNullable}}"
}{{^-last}},
{{/-last}}
{{/vars}}
Expand Down

0 comments on commit 1b035fb

Please sign in to comment.