Skip to content

Commit

Permalink
Fixed issue #296
Browse files Browse the repository at this point in the history
  • Loading branch information
uladzimir_paliukhovich committed Jan 14, 2022
1 parent 8e35790 commit b8f6092
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/src/code_generators/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const kBasicTypes = [
];

const kMap = 'Map';
const kMapStringDynamic = 'Map<String,dynamic>';

const kChopperService = 'ChopperService';
const kChopperApi = 'ChopperApi';
Expand All @@ -43,6 +44,7 @@ const kFormData = 'formData';
const kDefaultBodyParameter = 'Object';
const kField = 'Field';
const kRequestTypeOptions = 'options';
const kAdditionalProperties = 'additionalProperties';

const successDescriptions = ['Success', 'OK', 'default response'];

Expand Down
4 changes: 3 additions & 1 deletion lib/src/code_generators/swagger_models_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,9 @@ abstract class SwaggerModelsGenerator {

var typeName = '';

if (val['\$ref'] != null) {
if (val.containsKey(kAdditionalProperties)) {
typeName = kMapStringDynamic;
} else if (val['\$ref'] != null) {
typeName = val['\$ref'].toString().split('/').last.pascalCase +
options.modelPostfix;
} else {
Expand Down

0 comments on commit b8f6092

Please sign in to comment.