Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Uint8list by List<int> because it cause trouble with last versions of jaguar #3871

Merged
merged 1 commit into from
Sep 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class DartJaguarClientCodegen extends DartClientCodegen {
modelToIgnore.add("object");
modelToIgnore.add("list");
modelToIgnore.add("file");
modelToIgnore.add("uint8list");
modelToIgnore.add("list<int>");
}

private static final String SERIALIZATION_JSON = "json";
Expand All @@ -63,8 +63,8 @@ public DartJaguarClientCodegen() {
cliOptions.add(new CliOption(NULLABLE_FIELDS, "Is the null fields should be in the JSON payload"));
cliOptions.add(new CliOption(SERIALIZATION_FORMAT, "Choose serialization format JSON or PROTO is supported"));

typeMapping.put("file", "Uint8List");
typeMapping.put("binary", "Uint8List");
typeMapping.put("file", "List<int>");
typeMapping.put("binary", "List<int>");

protoTypeMapping.put("Array", "repeated");
protoTypeMapping.put("array", "repeated");
Expand Down Expand Up @@ -247,19 +247,19 @@ public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> o
}

for (CodegenParameter param : op.allParams) {
if (param.baseType != null && param.baseType.equalsIgnoreCase("Uint8List") && isMultipart) {
if (param.baseType != null && param.baseType.equalsIgnoreCase("List<int>") && isMultipart) {
param.baseType = "MultipartFile";
param.dataType = "MultipartFile";
}
}
for (CodegenParameter param : op.formParams) {
if (param.baseType != null && param.baseType.equalsIgnoreCase("Uint8List") && isMultipart) {
if (param.baseType != null && param.baseType.equalsIgnoreCase("List<int>") && isMultipart) {
param.baseType = "MultipartFile";
param.dataType = "MultipartFile";
}
}
for (CodegenParameter param : op.bodyParams) {
if (param.baseType != null && param.baseType.equalsIgnoreCase("Uint8List") && isMultipart) {
if (param.baseType != null && param.baseType.equalsIgnoreCase("List<int>") && isMultipart) {
param.baseType = "MultipartFile";
param.dataType = "MultipartFile";
}
Expand All @@ -274,8 +274,6 @@ public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> o
for (String item : op.imports) {
if (!modelToIgnore.contains(item.toLowerCase(Locale.ROOT))) {
imports.add(underscore(item));
} else if (item.equalsIgnoreCase("Uint8List")) {
fullImports.add("dart:typed_data");
}
}
modelImports.addAll(imports);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'dart:async';

import 'package:openapi/model/pet.dart';
import 'package:openapi/model/api_response.dart';
import 'dart:typed_data';

part 'pet_api.jretro.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'dart:async';

import 'package:openapi/model/pet.pb.dart';
import 'package:openapi/model/api_response.pb.dart';
import 'dart:typed_data';

part 'pet_api.jretro.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'dart:async';

import 'package:openapi/model/pet.dart';
import 'package:openapi/model/api_response.dart';
import 'dart:typed_data';

part 'pet_api.jretro.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'dart:async';

import 'package:openapi/model/pet.pb.dart';
import 'package:openapi/model/api_response.pb.dart';
import 'dart:typed_data';

part 'pet_api.jretro.dart';

Expand Down