Skip to content

Commit

Permalink
Fix error in Symfony models swagger-api#5985
Browse files Browse the repository at this point in the history
  • Loading branch information
ksm2 committed Jul 9, 2017
1 parent c29e16f commit 83106ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ public Map<String, Object> postProcessModels(Map<String, Object> objs) {
final String importType = var.datatype.replaceFirst("\\[\\]$", "");
final String dataType = extractSimpleName(var.datatype);
final boolean isScalarType = typeMapping.containsValue(importType);
var.vendorExtensions.put("x-fullType", var.datatype);
if (!isScalarType) {
var.vendorExtensions.put("x-typeAnnotation", dataType.endsWith("[]") ? "array" : dataType);
imports.add(importType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
* @var array[]
*/
protected static $_attributes = [{{#vars}}
'{{name}}' => ['{{baseName}}', '{{{datatype}}}', {{#dataFormat}}'{{{dataFormat}}}'{{/dataFormat}}{{^dataFormat}}null{{/dataFormat}}, '{{setter}}', '{{getter}}'],{{/vars}}
'{{name}}' => ['{{baseName}}', '{{{vendorExtensions.x-fullType}}}', {{#dataFormat}}'{{{dataFormat}}}'{{/dataFormat}}{{^dataFormat}}null{{/dataFormat}}, '{{setter}}', '{{getter}}'],{{/vars}}
];
{{#vars}}{{#isEnum}}{{#allowableValues}}{{#enumVars}}
const {{enumName}}_{{{name}}} = {{{value}}};
Expand Down

0 comments on commit 83106ce

Please sign in to comment.