Skip to content

Commit a1bf170

Browse files
committed
fix(crystal): make optional parameters truly optional
1 parent 265da25 commit a1bf170

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • modules/openapi-generator/src/main/resources/crystal

modules/openapi-generator/src/main/resources/crystal/api.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module {{moduleName}}
2323
{{/required}}
2424
{{/allParams}}
2525
# @return [{{{returnType}}}{{^returnType}}nil{{/returnType}}]
26-
def {{operationId}}({{#allParams}}{{paramName}} : {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}})
26+
def {{operationId}}({{#allParams}}{{paramName}} : {{{dataType}}}{{^required}}?{{/required}}{{^required}} = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}})
2727
{{#returnType}}data, _status_code, _headers = {{/returnType}}{{operationId}}_with_http_info({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}})
2828
{{#returnType}}data{{/returnType}}{{^returnType}}nil{{/returnType}}
2929
end
@@ -40,7 +40,7 @@ module {{moduleName}}
4040
{{/required}}
4141
{{/allParams}}
4242
# @return [Array<({{{returnType}}}{{^returnType}}nil{{/returnType}}, Integer, Hash)>] {{#returnType}}{{{.}}} data{{/returnType}}{{^returnType}}nil{{/returnType}}, response status code and response headers
43-
def {{operationId}}_with_http_info({{#allParams}}{{paramName}} : {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}})
43+
def {{operationId}}_with_http_info({{#allParams}}{{paramName}} : {{{dataType}}}{{^required}}?{{/required}}{{^required}} = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}})
4444
if @api_client.config.debugging
4545
Log.debug {"Calling API: {{classname}}.{{operationId}} ..."}
4646
end

0 commit comments

Comments
 (0)