forked from loafle/openapi-generator-original
[dart] Improve types & imports (#9167)
* [dart] Improve types & imports * don't use importMapping as it is intended for something different that is not possible in dart * introduce imports map for dart specific features * always import `dart:core` * get rid of additionalReservedWords * fix `--type-mappings` not working * use required type mappings in samples * no longer define additional reserved words as it is impossible to list all anyways, they can now be configured via type-mapping parameter * simplify dio imports * Don't use guava for map instantiation * Update docs
This commit is contained in:
parent
acedd1cfba
commit
065c0281fa
@ -2,5 +2,9 @@ generatorName: dart-dio-next
|
|||||||
outputDir: samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake
|
outputDir: samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio
|
templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio
|
||||||
|
typeMappings:
|
||||||
|
Client: "ModelClient"
|
||||||
|
File: "ModelFile"
|
||||||
|
EnumClass: "ModelEnumClass"
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
hideGenerationTimestamp: "true"
|
hideGenerationTimestamp: "true"
|
||||||
|
@ -2,5 +2,9 @@ generatorName: dart-dio
|
|||||||
outputDir: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake
|
outputDir: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/dart-dio
|
templateDir: modules/openapi-generator/src/main/resources/dart-dio
|
||||||
|
typeMappings:
|
||||||
|
Client: "ModelClient"
|
||||||
|
File: "ModelFile"
|
||||||
|
EnumClass: "ModelEnumClass"
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
hideGenerationTimestamp: "true"
|
hideGenerationTimestamp: "true"
|
||||||
|
@ -2,5 +2,8 @@ generatorName: dart
|
|||||||
outputDir: samples/openapi3/client/petstore/dart2/petstore_client_lib_fake
|
outputDir: samples/openapi3/client/petstore/dart2/petstore_client_lib_fake
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/dart2
|
templateDir: modules/openapi-generator/src/main/resources/dart2
|
||||||
|
typeMappings:
|
||||||
|
Client: "ModelClient"
|
||||||
|
File: "ModelFile"
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
hideGenerationTimestamp: "true"
|
hideGenerationTimestamp: "true"
|
||||||
|
@ -2,6 +2,9 @@ generatorName: dart
|
|||||||
outputDir: samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake
|
outputDir: samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/dart2
|
templateDir: modules/openapi-generator/src/main/resources/dart2
|
||||||
|
typeMappings:
|
||||||
|
Client: "ModelClient"
|
||||||
|
File: "ModelFile"
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
hideGenerationTimestamp: "true"
|
hideGenerationTimestamp: "true"
|
||||||
serializationLibrary: json_serializable
|
serializationLibrary: json_serializable
|
||||||
|
@ -44,7 +44,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
<li>String</li>
|
<li>String</li>
|
||||||
<li>bool</li>
|
<li>bool</li>
|
||||||
<li>double</li>
|
<li>double</li>
|
||||||
<li>dynamic</li>
|
|
||||||
<li>int</li>
|
<li>int</li>
|
||||||
<li>num</li>
|
<li>num</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -30,11 +30,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|
|
||||||
| Type/Alias | Imports |
|
| Type/Alias | Imports |
|
||||||
| ---------- | ------- |
|
| ---------- | ------- |
|
||||||
|BuiltList|package:built_collection/built_collection.dart|
|
|
||||||
|BuiltMap|package:built_collection/built_collection.dart|
|
|
||||||
|BuiltSet|package:built_collection/built_collection.dart|
|
|
||||||
|JsonObject|package:built_value/json_object.dart|
|
|
||||||
|Uint8List|dart:typed_data|
|
|
||||||
|
|
||||||
|
|
||||||
## INSTANTIATION TYPES
|
## INSTANTIATION TYPES
|
||||||
@ -49,7 +44,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
<li>String</li>
|
<li>String</li>
|
||||||
<li>bool</li>
|
<li>bool</li>
|
||||||
<li>double</li>
|
<li>double</li>
|
||||||
<li>dynamic</li>
|
|
||||||
<li>int</li>
|
<li>int</li>
|
||||||
<li>num</li>
|
<li>num</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -44,7 +44,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
<li>String</li>
|
<li>String</li>
|
||||||
<li>bool</li>
|
<li>bool</li>
|
||||||
<li>double</li>
|
<li>double</li>
|
||||||
<li>dynamic</li>
|
|
||||||
<li>int</li>
|
<li>int</li>
|
||||||
<li>num</li>
|
<li>num</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -43,7 +43,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
<li>String</li>
|
<li>String</li>
|
||||||
<li>bool</li>
|
<li>bool</li>
|
||||||
<li>double</li>
|
<li>double</li>
|
||||||
<li>dynamic</li>
|
|
||||||
<li>int</li>
|
<li>int</li>
|
||||||
<li>num</li>
|
<li>num</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import io.swagger.v3.oas.models.Operation;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
import io.swagger.v3.oas.models.media.ArraySchema;
|
||||||
@ -51,9 +52,7 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
|||||||
protected String apiTestPath = "test" + File.separator;
|
protected String apiTestPath = "test" + File.separator;
|
||||||
protected String modelTestPath = "test" + File.separator;
|
protected String modelTestPath = "test" + File.separator;
|
||||||
|
|
||||||
// Names that must not be used as model names because they clash with existing
|
protected Map<String, String> imports = new HashMap<>();
|
||||||
// default imports (dart:io, dart:async, package:http etc.) but are not basic dataTypes.
|
|
||||||
protected Set<String> additionalReservedWords;
|
|
||||||
|
|
||||||
public AbstractDartCodegen() {
|
public AbstractDartCodegen() {
|
||||||
super();
|
super();
|
||||||
@ -112,13 +111,13 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
|||||||
}
|
}
|
||||||
setReservedWordsLowerCase(reservedWordsList);
|
setReservedWordsLowerCase(reservedWordsList);
|
||||||
|
|
||||||
|
// These types return isPrimitive=true in templates
|
||||||
languageSpecificPrimitives = Sets.newHashSet(
|
languageSpecificPrimitives = Sets.newHashSet(
|
||||||
"String",
|
"String",
|
||||||
"bool",
|
"bool",
|
||||||
"int",
|
"int",
|
||||||
"num",
|
"num",
|
||||||
"double",
|
"double"
|
||||||
"dynamic"
|
|
||||||
);
|
);
|
||||||
|
|
||||||
typeMapping = new HashMap<>();
|
typeMapping = new HashMap<>();
|
||||||
@ -149,29 +148,31 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
|||||||
typeMapping.put("object", "Object");
|
typeMapping.put("object", "Object");
|
||||||
typeMapping.put("AnyType", "Object");
|
typeMapping.put("AnyType", "Object");
|
||||||
|
|
||||||
// DataTypes of the above values which are automatically imported.
|
// Data types of the above values which are automatically imported
|
||||||
// They are also not allowed to be model names.
|
|
||||||
defaultIncludes = Sets.newHashSet(
|
defaultIncludes = Sets.newHashSet(
|
||||||
"String",
|
"String",
|
||||||
"bool",
|
"bool",
|
||||||
"int",
|
"int",
|
||||||
"num",
|
"num",
|
||||||
"double",
|
"double",
|
||||||
"dynamic",
|
|
||||||
"List",
|
"List",
|
||||||
"Set",
|
"Set",
|
||||||
"Map",
|
"Map",
|
||||||
"DateTime",
|
"DateTime",
|
||||||
"Object",
|
"Object"
|
||||||
"MultipartFile"
|
|
||||||
);
|
);
|
||||||
|
|
||||||
additionalReservedWords = Sets.newHashSet(
|
imports.put("String", "dart:core");
|
||||||
"File",
|
imports.put("bool", "dart:core");
|
||||||
"Client",
|
imports.put("int", "dart:core");
|
||||||
"Future",
|
imports.put("num", "dart:core");
|
||||||
"Response"
|
imports.put("double", "dart:core");
|
||||||
);
|
imports.put("List", "dart:core");
|
||||||
|
imports.put("Set", "dart:core");
|
||||||
|
imports.put("Map", "dart:core");
|
||||||
|
imports.put("DateTime", "dart:core");
|
||||||
|
imports.put("Object", "dart:core");
|
||||||
|
imports.put("MultipartFile", "package:http/http.dart");
|
||||||
|
|
||||||
cliOptions.add(new CliOption(PUB_LIBRARY, "Library name in generated code"));
|
cliOptions.add(new CliOption(PUB_LIBRARY, "Library name in generated code"));
|
||||||
cliOptions.add(new CliOption(PUB_NAME, "Name in generated pubspec"));
|
cliOptions.add(new CliOption(PUB_NAME, "Name in generated pubspec"));
|
||||||
@ -182,7 +183,6 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
|||||||
cliOptions.add(new CliOption(PUB_HOMEPAGE, "Homepage in generated pubspec"));
|
cliOptions.add(new CliOption(PUB_HOMEPAGE, "Homepage in generated pubspec"));
|
||||||
cliOptions.add(new CliOption(USE_ENUM_EXTENSION, "Allow the 'x-enum-values' extension for enums"));
|
cliOptions.add(new CliOption(USE_ENUM_EXTENSION, "Allow the 'x-enum-values' extension for enums"));
|
||||||
cliOptions.add(new CliOption(CodegenConstants.SOURCE_FOLDER, "Source folder for generated code"));
|
cliOptions.add(new CliOption(CodegenConstants.SOURCE_FOLDER, "Source folder for generated code"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -279,13 +279,17 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean needToImport(String type) {
|
||||||
|
// Import everything, unless it is from dart:core.
|
||||||
|
return StringUtils.isNotBlank(type) && (!imports.containsKey(type) || !imports.get(type).equals("dart:core"));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isReservedWord(String word) {
|
protected boolean isReservedWord(String word) {
|
||||||
// consider everything as reserved that is either a keyword,
|
// consider everything as reserved that is either a keyword,
|
||||||
// a default included type, or a type include through some library
|
// a default included type, or a type include through some library
|
||||||
return super.isReservedWord(word) ||
|
return super.isReservedWord(word) || defaultIncludes().contains(word);
|
||||||
defaultIncludes().contains(word) ||
|
|
||||||
additionalReservedWords.contains(word);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -367,20 +371,34 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toModelName(final String name) {
|
public String toModelName(final String name) {
|
||||||
String nameWithPrefixSuffix = sanitizeName(name);
|
String sanitizedName = sanitizeName(name);
|
||||||
|
|
||||||
if (!StringUtils.isEmpty(modelNamePrefix)) {
|
if (!StringUtils.isEmpty(modelNamePrefix)) {
|
||||||
// add '_' so that model name can be camelized correctly
|
// add '_' so that model name can be camelized correctly
|
||||||
nameWithPrefixSuffix = modelNamePrefix + "_" + nameWithPrefixSuffix;
|
sanitizedName = modelNamePrefix + "_" + sanitizedName;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!StringUtils.isEmpty(modelNameSuffix)) {
|
if (!StringUtils.isEmpty(modelNameSuffix)) {
|
||||||
// add '_' so that model name can be camelized correctly
|
// add '_' so that model name can be camelized correctly
|
||||||
nameWithPrefixSuffix = nameWithPrefixSuffix + "_" + modelNameSuffix;
|
sanitizedName = sanitizedName + "_" + modelNameSuffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
// camelize the model name
|
// camelize the model name
|
||||||
// phone_number => PhoneNumber
|
// phone_number => PhoneNumber
|
||||||
final String camelizedName = camelize(nameWithPrefixSuffix);
|
final String camelizedName = camelize(sanitizedName);
|
||||||
|
|
||||||
|
// Check if there is a mapping that can be used
|
||||||
|
if (typeMapping().containsKey(camelizedName)) {
|
||||||
|
String typeName = typeMapping().get(camelizedName);
|
||||||
|
if (imports.containsKey(typeName)) {
|
||||||
|
// Anything with an import mapping is likely
|
||||||
|
// generator specific and can not be used as model name.
|
||||||
|
final String modelName = "Model" + camelizedName;
|
||||||
|
LOGGER.warn("{} (existing type) cannot be used as model name. Renamed to {}", camelizedName, modelName);
|
||||||
|
return modelName;
|
||||||
|
}
|
||||||
|
return typeName;
|
||||||
|
}
|
||||||
|
|
||||||
// model name cannot use reserved keyword, e.g. return
|
// model name cannot use reserved keyword, e.g. return
|
||||||
if (isReservedWord(camelizedName)) {
|
if (isReservedWord(camelizedName)) {
|
||||||
@ -473,11 +491,8 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
|||||||
if (openAPIType == null) {
|
if (openAPIType == null) {
|
||||||
LOGGER.error("No Type defined for Schema {}", p);
|
LOGGER.error("No Type defined for Schema {}", p);
|
||||||
}
|
}
|
||||||
if (typeMapping.containsKey(openAPIType)) {
|
if (typeMapping().containsKey(openAPIType)) {
|
||||||
return typeMapping.get(openAPIType);
|
return typeMapping().get(openAPIType);
|
||||||
}
|
|
||||||
if (languageSpecificPrimitives.contains(openAPIType)) {
|
|
||||||
return openAPIType;
|
|
||||||
}
|
}
|
||||||
return toModelName(openAPIType);
|
return toModelName(openAPIType);
|
||||||
}
|
}
|
||||||
@ -607,8 +622,9 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
|||||||
|
|
||||||
// operationId starts with a number
|
// operationId starts with a number
|
||||||
if (operationId.matches("^\\d.*")) {
|
if (operationId.matches("^\\d.*")) {
|
||||||
LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, camelize("call_" + operationId), true);
|
String newOperationId = camelize("call_" + operationId, true);
|
||||||
operationId = camelize("call_" + operationId, true);
|
LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, newOperationId);
|
||||||
|
operationId = newOperationId;
|
||||||
}
|
}
|
||||||
|
|
||||||
return operationId;
|
return operationId;
|
||||||
|
@ -37,20 +37,6 @@ public class DartClientCodegen extends AbstractDartCodegen {
|
|||||||
|
|
||||||
public DartClientCodegen() {
|
public DartClientCodegen() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
additionalReservedWords.addAll(
|
|
||||||
Sets.newHashSet(
|
|
||||||
"StreamedRequest",
|
|
||||||
"ApiClient",
|
|
||||||
"QueryParam",
|
|
||||||
"Authentication",
|
|
||||||
"HttpBasicAuth",
|
|
||||||
"HttpBearerAuth",
|
|
||||||
"ApiKeyAuth",
|
|
||||||
"OAuth"
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
final CliOption serializationLibrary = CliOption.newString(CodegenConstants.SERIALIZATION_LIBRARY,
|
final CliOption serializationLibrary = CliOption.newString(CodegenConstants.SERIALIZATION_LIBRARY,
|
||||||
"Specify serialization library");
|
"Specify serialization library");
|
||||||
serializationLibrary.setDefault(SERIALIZATION_LIBRARY_NATIVE);
|
serializationLibrary.setDefault(SERIALIZATION_LIBRARY_NATIVE);
|
||||||
|
@ -30,6 +30,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static org.openapitools.codegen.utils.StringUtils.underscore;
|
import static org.openapitools.codegen.utils.StringUtils.underscore;
|
||||||
|
|
||||||
@ -77,22 +78,11 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
|
|||||||
typeMapping.put("object", "JsonObject");
|
typeMapping.put("object", "JsonObject");
|
||||||
typeMapping.put("AnyType", "JsonObject");
|
typeMapping.put("AnyType", "JsonObject");
|
||||||
|
|
||||||
additionalReservedWords.addAll(Sets.newHashSet(
|
imports.put("BuiltList", "package:built_collection/built_collection.dart");
|
||||||
"EnumClass",
|
imports.put("BuiltSet", "package:built_collection/built_collection.dart");
|
||||||
// The following are reserved dataTypes but can not be added to defaultIncludes
|
imports.put("BuiltMap", "package:built_collection/built_collection.dart");
|
||||||
// as this would prevent them from being added to the imports.
|
imports.put("JsonObject", "package:built_value/json_object.dart");
|
||||||
"BuiltList",
|
imports.put("Uint8List", "dart:typed_data");
|
||||||
"BuiltSet",
|
|
||||||
"BuiltMap",
|
|
||||||
"Uint8List",
|
|
||||||
"JsonObject"
|
|
||||||
));
|
|
||||||
|
|
||||||
importMapping.put("BuiltList", "package:built_collection/built_collection.dart");
|
|
||||||
importMapping.put("BuiltSet", "package:built_collection/built_collection.dart");
|
|
||||||
importMapping.put("BuiltMap", "package:built_collection/built_collection.dart");
|
|
||||||
importMapping.put("JsonObject", "package:built_value/json_object.dart");
|
|
||||||
importMapping.put("Uint8List", "dart:typed_data");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDateLibrary() {
|
public String getDateLibrary() {
|
||||||
@ -210,9 +200,8 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
|
|||||||
typeMapping.put("Date", "OffsetDate");
|
typeMapping.put("Date", "OffsetDate");
|
||||||
typeMapping.put("DateTime", "OffsetDateTime");
|
typeMapping.put("DateTime", "OffsetDateTime");
|
||||||
typeMapping.put("datetime", "OffsetDateTime");
|
typeMapping.put("datetime", "OffsetDateTime");
|
||||||
additionalReservedWords.addAll(Sets.newHashSet("OffsetDate", "OffsetDateTime"));
|
imports.put("OffsetDate", "package:time_machine/time_machine.dart");
|
||||||
importMapping.put("OffsetDate", "package:time_machine/time_machine.dart");
|
imports.put("OffsetDateTime", "package:time_machine/time_machine.dart");
|
||||||
importMapping.put("OffsetDateTime", "package:time_machine/time_machine.dart");
|
|
||||||
supportingFiles.add(new SupportingFile("local_date_serializer.mustache", libFolder, "local_date_serializer.dart"));
|
supportingFiles.add(new SupportingFile("local_date_serializer.mustache", libFolder, "local_date_serializer.dart"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -225,21 +214,9 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
|
|||||||
|
|
||||||
for (Object _mo : models) {
|
for (Object _mo : models) {
|
||||||
Map<String, Object> mo = (Map<String, Object>) _mo;
|
Map<String, Object> mo = (Map<String, Object>) _mo;
|
||||||
Set<String> modelImports = new HashSet<>();
|
|
||||||
CodegenModel cm = (CodegenModel) mo.get("model");
|
CodegenModel cm = (CodegenModel) mo.get("model");
|
||||||
for (String modelImport : cm.imports) {
|
cm.imports = rewriteImports(cm.imports);
|
||||||
if (needToImport(modelImport)) {
|
cm.vendorExtensions.put("x-has-vars", !cm.vars.isEmpty());
|
||||||
if (importMapping().containsKey(modelImport)) {
|
|
||||||
modelImports.add(importMapping().get(modelImport));
|
|
||||||
} else {
|
|
||||||
modelImports.add("package:" + pubName + "/model/" + underscore(modelImport) + ".dart");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cm.imports = modelImports;
|
|
||||||
boolean hasVars = cm.vars.size() > 0;
|
|
||||||
cm.vendorExtensions.put("x-has-vars", hasVars);
|
|
||||||
}
|
}
|
||||||
return objs;
|
return objs;
|
||||||
}
|
}
|
||||||
@ -292,8 +269,7 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
|
|||||||
List<CodegenOperation> operationList = (List<CodegenOperation>) operations.get("operation");
|
List<CodegenOperation> operationList = (List<CodegenOperation>) operations.get("operation");
|
||||||
|
|
||||||
Set<Map<String, Object>> serializers = new HashSet<>();
|
Set<Map<String, Object>> serializers = new HashSet<>();
|
||||||
Set<String> modelImports = new HashSet<>();
|
Set<String> resultImports = new HashSet<>();
|
||||||
Set<String> fullImports = new HashSet<>();
|
|
||||||
|
|
||||||
for (CodegenOperation op : operationList) {
|
for (CodegenOperation op : operationList) {
|
||||||
op.httpMethod = op.httpMethod.toLowerCase(Locale.ROOT);
|
op.httpMethod = op.httpMethod.toLowerCase(Locale.ROOT);
|
||||||
@ -331,23 +307,11 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
|
|||||||
op.vendorExtensions.put("x-is-form", isForm);
|
op.vendorExtensions.put("x-is-form", isForm);
|
||||||
op.vendorExtensions.put("x-is-multipart", isMultipart);
|
op.vendorExtensions.put("x-is-multipart", isMultipart);
|
||||||
|
|
||||||
|
resultImports.addAll(rewriteImports(op.imports));
|
||||||
if (op.getHasFormParams()) {
|
if (op.getHasFormParams()) {
|
||||||
fullImports.add("package:" + pubName + "/api_util.dart");
|
resultImports.add("package:" + pubName + "/api_util.dart");
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<String> imports = new HashSet<>();
|
|
||||||
for (String item : op.imports) {
|
|
||||||
if (needToImport(item)) {
|
|
||||||
if (importMapping().containsKey(item)) {
|
|
||||||
fullImports.add(importMapping().get(item));
|
|
||||||
} else {
|
|
||||||
imports.add(underscore(item));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
modelImports.addAll(imports);
|
|
||||||
op.imports = imports;
|
|
||||||
|
|
||||||
if (op.returnContainer != null) {
|
if (op.returnContainer != null) {
|
||||||
final Map<String, Object> serializer = new HashMap<>();
|
final Map<String, Object> serializer = new HashMap<>();
|
||||||
serializer.put("isArray", Objects.equals("array", op.returnContainer) || Objects.equals("set", op.returnContainer));
|
serializer.put("isArray", Objects.equals("array", op.returnContainer) || Objects.equals("set", op.returnContainer));
|
||||||
@ -358,11 +322,21 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
objs.put("modelImports", modelImports);
|
objs.put("imports", resultImports.stream().sorted().collect(Collectors.toList()));
|
||||||
objs.put("fullImports", fullImports);
|
|
||||||
objs.put("serializers", serializers);
|
objs.put("serializers", serializers);
|
||||||
|
|
||||||
return objs;
|
return objs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Set<String> rewriteImports(Set<String> originalImports) {
|
||||||
|
Set<String> resultImports = Sets.newHashSet();
|
||||||
|
for (String modelImport : originalImports) {
|
||||||
|
if (imports.containsKey(modelImport)) {
|
||||||
|
resultImports.add(imports.get(modelImport));
|
||||||
|
} else {
|
||||||
|
resultImports.add("package:" + pubName + "/model/" + underscore(modelImport) + ".dart");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return resultImports;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static org.openapitools.codegen.utils.StringUtils.underscore;
|
import static org.openapitools.codegen.utils.StringUtils.underscore;
|
||||||
|
|
||||||
@ -186,22 +187,11 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen {
|
|||||||
typeMapping.put("object", "JsonObject");
|
typeMapping.put("object", "JsonObject");
|
||||||
typeMapping.put("AnyType", "JsonObject");
|
typeMapping.put("AnyType", "JsonObject");
|
||||||
|
|
||||||
additionalReservedWords.addAll(Sets.newHashSet(
|
imports.put("BuiltList", "package:built_collection/built_collection.dart");
|
||||||
"EnumClass",
|
imports.put("BuiltSet", "package:built_collection/built_collection.dart");
|
||||||
// The following are reserved dataTypes but can not be added to defaultIncludes
|
imports.put("BuiltMap", "package:built_collection/built_collection.dart");
|
||||||
// as this would prevent them from being added to the imports.
|
imports.put("JsonObject", "package:built_value/json_object.dart");
|
||||||
"BuiltList",
|
imports.put("Uint8List", "dart:typed_data");
|
||||||
"BuiltSet",
|
|
||||||
"BuiltMap",
|
|
||||||
"Uint8List",
|
|
||||||
"JsonObject"
|
|
||||||
));
|
|
||||||
|
|
||||||
importMapping.put("BuiltList", "package:built_collection/built_collection.dart");
|
|
||||||
importMapping.put("BuiltSet", "package:built_collection/built_collection.dart");
|
|
||||||
importMapping.put("BuiltMap", "package:built_collection/built_collection.dart");
|
|
||||||
importMapping.put("JsonObject", "package:built_value/json_object.dart");
|
|
||||||
importMapping.put("Uint8List", "dart:typed_data");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configureDateLibrary(String srcFolder) {
|
private void configureDateLibrary(String srcFolder) {
|
||||||
@ -212,9 +202,8 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen {
|
|||||||
typeMapping.put("Date", "OffsetDate");
|
typeMapping.put("Date", "OffsetDate");
|
||||||
typeMapping.put("DateTime", "OffsetDateTime");
|
typeMapping.put("DateTime", "OffsetDateTime");
|
||||||
typeMapping.put("datetime", "OffsetDateTime");
|
typeMapping.put("datetime", "OffsetDateTime");
|
||||||
additionalReservedWords.addAll(Sets.newHashSet("OffsetDate", "OffsetDateTime"));
|
imports.put("OffsetDate", "package:time_machine/time_machine.dart");
|
||||||
importMapping.put("OffsetDate", "package:time_machine/time_machine.dart");
|
imports.put("OffsetDateTime", "package:time_machine/time_machine.dart");
|
||||||
importMapping.put("OffsetDateTime", "package:time_machine/time_machine.dart");
|
|
||||||
if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) {
|
if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) {
|
||||||
supportingFiles.add(new SupportingFile("serialization/built_value/local_date_serializer.mustache", srcFolder, "local_date_serializer.dart"));
|
supportingFiles.add(new SupportingFile("serialization/built_value/local_date_serializer.mustache", srcFolder, "local_date_serializer.dart"));
|
||||||
}
|
}
|
||||||
@ -261,21 +250,9 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen {
|
|||||||
|
|
||||||
for (Object _mo : models) {
|
for (Object _mo : models) {
|
||||||
Map<String, Object> mo = (Map<String, Object>) _mo;
|
Map<String, Object> mo = (Map<String, Object>) _mo;
|
||||||
Set<String> modelImports = new HashSet<>();
|
|
||||||
CodegenModel cm = (CodegenModel) mo.get("model");
|
CodegenModel cm = (CodegenModel) mo.get("model");
|
||||||
for (String modelImport : cm.imports) {
|
cm.imports = rewriteImports(cm.imports);
|
||||||
if (needToImport(modelImport)) {
|
cm.vendorExtensions.put("x-has-vars", !cm.vars.isEmpty());
|
||||||
if (importMapping().containsKey(modelImport)) {
|
|
||||||
modelImports.add(importMapping().get(modelImport));
|
|
||||||
} else {
|
|
||||||
modelImports.add("package:" + pubName + "/src/model/" + underscore(modelImport) + ".dart");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cm.imports = modelImports;
|
|
||||||
boolean hasVars = cm.vars.size() > 0;
|
|
||||||
cm.vendorExtensions.put("x-has-vars", hasVars);
|
|
||||||
}
|
}
|
||||||
return objs;
|
return objs;
|
||||||
}
|
}
|
||||||
@ -319,6 +296,7 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen {
|
|||||||
sb.append(")]");
|
sb.append(")]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> objs, List<Object> allModels) {
|
public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> objs, List<Object> allModels) {
|
||||||
objs = super.postProcessOperationsWithModels(objs, allModels);
|
objs = super.postProcessOperationsWithModels(objs, allModels);
|
||||||
@ -326,8 +304,7 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen {
|
|||||||
List<CodegenOperation> operationList = (List<CodegenOperation>) operations.get("operation");
|
List<CodegenOperation> operationList = (List<CodegenOperation>) operations.get("operation");
|
||||||
|
|
||||||
Set<Map<String, Object>> serializers = new HashSet<>();
|
Set<Map<String, Object>> serializers = new HashSet<>();
|
||||||
Set<String> modelImports = new HashSet<>();
|
Set<String> resultImports = new HashSet<>();
|
||||||
Set<String> fullImports = new HashSet<>();
|
|
||||||
|
|
||||||
for (CodegenOperation op : operationList) {
|
for (CodegenOperation op : operationList) {
|
||||||
op.httpMethod = op.httpMethod.toLowerCase(Locale.ROOT);
|
op.httpMethod = op.httpMethod.toLowerCase(Locale.ROOT);
|
||||||
@ -365,23 +342,11 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen {
|
|||||||
op.vendorExtensions.put("x-is-form", isForm);
|
op.vendorExtensions.put("x-is-form", isForm);
|
||||||
op.vendorExtensions.put("x-is-multipart", isMultipart);
|
op.vendorExtensions.put("x-is-multipart", isMultipart);
|
||||||
|
|
||||||
|
resultImports.addAll(rewriteImports(op.imports));
|
||||||
if (op.getHasFormParams()) {
|
if (op.getHasFormParams()) {
|
||||||
fullImports.add("package:" + pubName + "/src/api_util.dart");
|
resultImports.add("package:" + pubName + "/src/api_util.dart");
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<String> imports = new HashSet<>();
|
|
||||||
for (String item : op.imports) {
|
|
||||||
if (needToImport(item)) {
|
|
||||||
if (importMapping().containsKey(item)) {
|
|
||||||
fullImports.add(importMapping().get(item));
|
|
||||||
} else {
|
|
||||||
imports.add(underscore(item));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
modelImports.addAll(imports);
|
|
||||||
op.imports = imports;
|
|
||||||
|
|
||||||
if (op.returnContainer != null) {
|
if (op.returnContainer != null) {
|
||||||
final Map<String, Object> serializer = new HashMap<>();
|
final Map<String, Object> serializer = new HashMap<>();
|
||||||
serializer.put("isArray", Objects.equals("array", op.returnContainer) || Objects.equals("set", op.returnContainer));
|
serializer.put("isArray", Objects.equals("array", op.returnContainer) || Objects.equals("set", op.returnContainer));
|
||||||
@ -392,11 +357,21 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
objs.put("modelImports", modelImports);
|
objs.put("imports", resultImports.stream().sorted().collect(Collectors.toList()));
|
||||||
objs.put("fullImports", fullImports);
|
|
||||||
objs.put("serializers", serializers);
|
objs.put("serializers", serializers);
|
||||||
|
|
||||||
return objs;
|
return objs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Set<String> rewriteImports(Set<String> originalImports) {
|
||||||
|
Set<String> resultImports = Sets.newHashSet();
|
||||||
|
for (String modelImport : originalImports) {
|
||||||
|
if (imports.containsKey(modelImport)) {
|
||||||
|
resultImports.add(imports.get(modelImport));
|
||||||
|
} else {
|
||||||
|
resultImports.add("package:" + pubName + "/src/model/" + underscore(modelImport) + ".dart");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return resultImports;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,10 +4,8 @@ import 'package:dio/dio.dart';
|
|||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
|
|
||||||
{{#operations}}
|
{{#operations}}
|
||||||
{{#modelImports}}import 'package:{{pubName}}/model/{{.}}.dart';
|
{{#imports}}import '{{.}}';
|
||||||
{{/modelImports}}
|
{{/imports}}
|
||||||
{{#fullImports}}import '{{.}}';
|
|
||||||
{{/fullImports}}
|
|
||||||
|
|
||||||
class {{classname}} {
|
class {{classname}} {
|
||||||
|
|
||||||
|
@ -5,10 +5,8 @@ import 'dart:async';
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
|
|
||||||
{{#operations}}
|
{{#operations}}
|
||||||
{{#modelImports}}import 'package:{{pubName}}/src/model/{{.}}.dart';
|
{{#imports}}import '{{.}}';
|
||||||
{{/modelImports}}
|
{{/imports}}
|
||||||
{{#fullImports}}import '{{.}}';
|
|
||||||
{{/fullImports}}
|
|
||||||
|
|
||||||
class {{classname}} {
|
class {{classname}} {
|
||||||
|
|
||||||
|
@ -337,8 +337,8 @@ public class DartModelTest {
|
|||||||
{"sample name", "SampleName"},
|
{"sample name", "SampleName"},
|
||||||
{"List", "ModelList"},
|
{"List", "ModelList"},
|
||||||
{"list", "ModelList"},
|
{"list", "ModelList"},
|
||||||
{"File", "ModelFile"},
|
{"File", "TestModelFile"},
|
||||||
{"Client", "ModelClient"},
|
{"Client", "TestModelClient"},
|
||||||
{"String", "ModelString"},
|
{"String", "ModelString"},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -349,6 +349,8 @@ public class DartModelTest {
|
|||||||
final Schema model = new Schema();
|
final Schema model = new Schema();
|
||||||
final DefaultCodegen codegen = new DartClientCodegen();
|
final DefaultCodegen codegen = new DartClientCodegen();
|
||||||
codegen.setOpenAPI(openAPI);
|
codegen.setOpenAPI(openAPI);
|
||||||
|
codegen.typeMapping().put("File", "TestModelFile");
|
||||||
|
codegen.typeMapping().put("Client", "TestModelClient");
|
||||||
final CodegenModel cm = codegen.fromModel(name, model);
|
final CodegenModel cm = codegen.fromModel(name, model);
|
||||||
|
|
||||||
Assert.assertEquals(cm.name, name);
|
Assert.assertEquals(cm.name, name);
|
||||||
|
@ -380,10 +380,8 @@ public class DartDioModelTest {
|
|||||||
@DataProvider(name = "modelNames")
|
@DataProvider(name = "modelNames")
|
||||||
public static Object[][] modelNames() {
|
public static Object[][] modelNames() {
|
||||||
return new Object[][] {
|
return new Object[][] {
|
||||||
{"EnumClass", "ModelEnumClass"},
|
{"EnumClass", "TestModelEnumClass"},
|
||||||
{"JsonObject", "ModelJsonObject"},
|
{"JsonObject", "TestModelJsonObject"}
|
||||||
// OffsetDate is valid without timemachine date library
|
|
||||||
{"OffsetDate", "OffsetDate"},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -393,6 +391,8 @@ public class DartDioModelTest {
|
|||||||
final Schema model = new Schema();
|
final Schema model = new Schema();
|
||||||
final DartDioClientCodegen codegen = new DartDioClientCodegen();
|
final DartDioClientCodegen codegen = new DartDioClientCodegen();
|
||||||
codegen.setOpenAPI(openAPI);
|
codegen.setOpenAPI(openAPI);
|
||||||
|
codegen.typeMapping().put("EnumClass", "TestModelEnumClass");
|
||||||
|
codegen.typeMapping().put("JsonObject", "TestModelJsonObject");
|
||||||
final CodegenModel cm = codegen.fromModel(name, model);
|
final CodegenModel cm = codegen.fromModel(name, model);
|
||||||
|
|
||||||
Assert.assertEquals(cm.name, name);
|
Assert.assertEquals(cm.name, name);
|
||||||
@ -402,10 +402,9 @@ public class DartDioModelTest {
|
|||||||
@DataProvider(name = "modelNamesTimemachine")
|
@DataProvider(name = "modelNamesTimemachine")
|
||||||
public static Object[][] modelNamesTimemachine() {
|
public static Object[][] modelNamesTimemachine() {
|
||||||
return new Object[][] {
|
return new Object[][] {
|
||||||
{"EnumClass", "ModelEnumClass"},
|
{"EnumClass", "TestModelEnumClass"},
|
||||||
{"JsonObject", "ModelJsonObject"},
|
{"JsonObject", "TestModelJsonObject"},
|
||||||
// OffsetDate is not valid with timemachine date library
|
{"OffsetDate", "TestModelOffsetDate"},
|
||||||
{"OffsetDate", "ModelOffsetDate"},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -416,6 +415,9 @@ public class DartDioModelTest {
|
|||||||
final DartDioClientCodegen codegen = new DartDioClientCodegen();
|
final DartDioClientCodegen codegen = new DartDioClientCodegen();
|
||||||
codegen.setDateLibrary("timemachine");
|
codegen.setDateLibrary("timemachine");
|
||||||
codegen.processOpts();
|
codegen.processOpts();
|
||||||
|
codegen.typeMapping().put("EnumClass", "TestModelEnumClass");
|
||||||
|
codegen.typeMapping().put("JsonObject", "TestModelJsonObject");
|
||||||
|
codegen.typeMapping().put("OffsetDate", "TestModelOffsetDate");
|
||||||
codegen.setOpenAPI(openAPI);
|
codegen.setOpenAPI(openAPI);
|
||||||
final CodegenModel cm = codegen.fromModel(name, model);
|
final CodegenModel cm = codegen.fromModel(name, model);
|
||||||
|
|
||||||
|
@ -390,10 +390,8 @@ public class DartDioNextModelTest {
|
|||||||
@DataProvider(name = "modelNames")
|
@DataProvider(name = "modelNames")
|
||||||
public static Object[][] modelNames() {
|
public static Object[][] modelNames() {
|
||||||
return new Object[][] {
|
return new Object[][] {
|
||||||
{"EnumClass", "ModelEnumClass"},
|
{"EnumClass", "TestModelEnumClass"},
|
||||||
{"JsonObject", "ModelJsonObject"},
|
{"JsonObject", "TestModelJsonObject"},
|
||||||
// OffsetDate is valid without timemachine date library
|
|
||||||
{"OffsetDate", "OffsetDate"},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -405,7 +403,8 @@ public class DartDioNextModelTest {
|
|||||||
final DefaultCodegen codegen = new DartDioNextClientCodegen();
|
final DefaultCodegen codegen = new DartDioNextClientCodegen();
|
||||||
codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, DartDioNextClientCodegen.SERIALIZATION_LIBRARY_BUILT_VALUE);
|
codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, DartDioNextClientCodegen.SERIALIZATION_LIBRARY_BUILT_VALUE);
|
||||||
codegen.processOpts();
|
codegen.processOpts();
|
||||||
|
codegen.typeMapping().put("EnumClass", "TestModelEnumClass");
|
||||||
|
codegen.typeMapping().put("JsonObject", "TestModelJsonObject");
|
||||||
codegen.setOpenAPI(openAPI);
|
codegen.setOpenAPI(openAPI);
|
||||||
|
|
||||||
final CodegenModel cm = codegen.fromModel(name, model);
|
final CodegenModel cm = codegen.fromModel(name, model);
|
||||||
@ -417,10 +416,9 @@ public class DartDioNextModelTest {
|
|||||||
@DataProvider(name = "modelNamesTimemachine")
|
@DataProvider(name = "modelNamesTimemachine")
|
||||||
public static Object[][] modelNamesTimemachine() {
|
public static Object[][] modelNamesTimemachine() {
|
||||||
return new Object[][] {
|
return new Object[][] {
|
||||||
{"EnumClass", "ModelEnumClass"},
|
{"EnumClass", "TestModelEnumClass"},
|
||||||
{"JsonObject", "ModelJsonObject"},
|
{"JsonObject", "TestModelJsonObject"},
|
||||||
// OffsetDate is not valid with timemachine date library
|
{"OffsetDate", "TestModelOffsetDate"},
|
||||||
{"OffsetDate", "ModelOffsetDate"},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -431,7 +429,11 @@ public class DartDioNextModelTest {
|
|||||||
final DartDioNextClientCodegen codegen = new DartDioNextClientCodegen();
|
final DartDioNextClientCodegen codegen = new DartDioNextClientCodegen();
|
||||||
codegen.additionalProperties().put(DartDioNextClientCodegen.DATE_LIBRARY, DartDioNextClientCodegen.DATE_LIBRARY_TIME_MACHINE);
|
codegen.additionalProperties().put(DartDioNextClientCodegen.DATE_LIBRARY, DartDioNextClientCodegen.DATE_LIBRARY_TIME_MACHINE);
|
||||||
codegen.processOpts();
|
codegen.processOpts();
|
||||||
|
codegen.typeMapping().put("EnumClass", "TestModelEnumClass");
|
||||||
|
codegen.typeMapping().put("JsonObject", "TestModelJsonObject");
|
||||||
|
codegen.typeMapping().put("OffsetDate", "TestModelOffsetDate");
|
||||||
codegen.setOpenAPI(openAPI);
|
codegen.setOpenAPI(openAPI);
|
||||||
|
|
||||||
final CodegenModel cm = codegen.fromModel(name, model);
|
final CodegenModel cm = codegen.fromModel(name, model);
|
||||||
|
|
||||||
Assert.assertEquals(cm.name, name);
|
Assert.assertEquals(cm.name, name);
|
||||||
|
@ -7,16 +7,16 @@ import 'dart:async';
|
|||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
|
|
||||||
import 'package:openapi/src/model/file_schema_test_class.dart';
|
|
||||||
import 'package:openapi/src/model/outer_composite.dart';
|
|
||||||
import 'package:openapi/src/model/outer_object_with_enum_property.dart';
|
|
||||||
import 'package:openapi/src/model/user.dart';
|
|
||||||
import 'package:openapi/src/model/health_check_result.dart';
|
|
||||||
import 'package:openapi/src/model/pet.dart';
|
|
||||||
import 'package:openapi/src/model/model_client.dart';
|
|
||||||
import 'package:openapi/src/api_util.dart';
|
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
import 'package:built_collection/built_collection.dart';
|
import 'package:built_collection/built_collection.dart';
|
||||||
|
import 'package:openapi/src/api_util.dart';
|
||||||
|
import 'package:openapi/src/model/file_schema_test_class.dart';
|
||||||
|
import 'package:openapi/src/model/health_check_result.dart';
|
||||||
|
import 'package:openapi/src/model/model_client.dart';
|
||||||
|
import 'package:openapi/src/model/outer_composite.dart';
|
||||||
|
import 'package:openapi/src/model/outer_object_with_enum_property.dart';
|
||||||
|
import 'package:openapi/src/model/pet.dart';
|
||||||
|
import 'package:openapi/src/model/user.dart';
|
||||||
|
|
||||||
class FakeApi {
|
class FakeApi {
|
||||||
|
|
||||||
|
@ -7,11 +7,11 @@ import 'dart:async';
|
|||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
|
|
||||||
import 'package:openapi/src/model/pet.dart';
|
|
||||||
import 'package:openapi/src/model/api_response.dart';
|
|
||||||
import 'package:openapi/src/api_util.dart';
|
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
import 'package:built_collection/built_collection.dart';
|
import 'package:built_collection/built_collection.dart';
|
||||||
|
import 'package:openapi/src/api_util.dart';
|
||||||
|
import 'package:openapi/src/model/api_response.dart';
|
||||||
|
import 'package:openapi/src/model/pet.dart';
|
||||||
|
|
||||||
class PetApi {
|
class PetApi {
|
||||||
|
|
||||||
|
@ -7,8 +7,8 @@ import 'dart:async';
|
|||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
|
|
||||||
import 'package:openapi/src/model/order.dart';
|
|
||||||
import 'package:built_collection/built_collection.dart';
|
import 'package:built_collection/built_collection.dart';
|
||||||
|
import 'package:openapi/src/model/order.dart';
|
||||||
|
|
||||||
class StoreApi {
|
class StoreApi {
|
||||||
|
|
||||||
|
@ -7,8 +7,8 @@ import 'dart:async';
|
|||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
|
|
||||||
import 'package:openapi/src/model/user.dart';
|
|
||||||
import 'package:built_collection/built_collection.dart';
|
import 'package:built_collection/built_collection.dart';
|
||||||
|
import 'package:openapi/src/model/user.dart';
|
||||||
|
|
||||||
class UserApi {
|
class UserApi {
|
||||||
|
|
||||||
|
@ -16,5 +16,6 @@ void main() {
|
|||||||
test('to test the property `mapOfMapProperty`', () async {
|
test('to test the property `mapOfMapProperty`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -16,5 +16,6 @@ void main() {
|
|||||||
test('to test the property `color`', () async {
|
test('to test the property `color`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import 'package:test/test.dart';
|
import 'package:test/test.dart';
|
||||||
import 'package:openapi/openapi.dart';
|
import 'package:openapi/openapi.dart';
|
||||||
|
|
||||||
|
|
||||||
/// tests for AnotherFakeApi
|
/// tests for AnotherFakeApi
|
||||||
void main() {
|
void main() {
|
||||||
final instance = Openapi().getAnotherFakeApi();
|
final instance = Openapi().getAnotherFakeApi();
|
||||||
@ -14,5 +15,6 @@ void main() {
|
|||||||
test('test call123testSpecialTags', () async {
|
test('test call123testSpecialTags', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -21,5 +21,6 @@ void main() {
|
|||||||
test('to test the property `message`', () async {
|
test('to test the property `message`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,6 @@ void main() {
|
|||||||
test('to test the property `arrayArrayNumber`', () async {
|
test('to test the property `arrayArrayNumber`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,6 @@ void main() {
|
|||||||
test('to test the property `arrayNumber`', () async {
|
test('to test the property `arrayNumber`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -21,5 +21,6 @@ void main() {
|
|||||||
test('to test the property `arrayArrayOfModel`', () async {
|
test('to test the property `arrayArrayOfModel`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -32,10 +32,11 @@ void main() {
|
|||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
// Name of the pet
|
// Name of the pet
|
||||||
// String ATT_NAME
|
// String ATT_NAME
|
||||||
test('to test the property `ATT_NAME`', () async {
|
test('to test the property `ATT_NAME`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,6 @@ void main() {
|
|||||||
test('to test the property `declawed`', () async {
|
test('to test the property `declawed`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -21,5 +21,6 @@ void main() {
|
|||||||
test('to test the property `declawed`', () async {
|
test('to test the property `declawed`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -16,5 +16,6 @@ void main() {
|
|||||||
test('to test the property `name`', () async {
|
test('to test the property `name`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,6 @@ void main() {
|
|||||||
test('to test the property `class_`', () async {
|
test('to test the property `class_`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import 'package:test/test.dart';
|
import 'package:test/test.dart';
|
||||||
import 'package:openapi/openapi.dart';
|
import 'package:openapi/openapi.dart';
|
||||||
|
|
||||||
|
|
||||||
/// tests for DefaultApi
|
/// tests for DefaultApi
|
||||||
void main() {
|
void main() {
|
||||||
final instance = Openapi().getDefaultApi();
|
final instance = Openapi().getDefaultApi();
|
||||||
@ -10,5 +11,6 @@ void main() {
|
|||||||
test('test fooGet', () async {
|
test('test fooGet', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,6 @@ void main() {
|
|||||||
test('to test the property `breed`', () async {
|
test('to test the property `breed`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -21,5 +21,6 @@ void main() {
|
|||||||
test('to test the property `breed`', () async {
|
test('to test the property `breed`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -16,5 +16,6 @@ void main() {
|
|||||||
test('to test the property `arrayEnum`', () async {
|
test('to test the property `arrayEnum`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -46,5 +46,6 @@ void main() {
|
|||||||
test('to test the property `outerEnumIntegerDefaultValue`', () async {
|
test('to test the property `outerEnumIntegerDefaultValue`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import 'package:test/test.dart';
|
import 'package:test/test.dart';
|
||||||
import 'package:openapi/openapi.dart';
|
import 'package:openapi/openapi.dart';
|
||||||
|
|
||||||
|
|
||||||
/// tests for FakeApi
|
/// tests for FakeApi
|
||||||
void main() {
|
void main() {
|
||||||
final instance = Openapi().getFakeApi();
|
final instance = Openapi().getFakeApi();
|
||||||
@ -76,9 +77,9 @@ void main() {
|
|||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
//
|
//
|
||||||
// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
//
|
//
|
||||||
//Future testEndpointParameters(num number, double double_, String patternWithoutDelimiter, String byte, { int integer, int int32, int int64, double float, String string, Uint8List binary, DateTime date, DateTime dateTime, String password, String callback }) async
|
//Future testEndpointParameters(num number, double double_, String patternWithoutDelimiter, String byte, { int integer, int int32, int int64, double float, String string, Uint8List binary, DateTime date, DateTime dateTime, String password, String callback }) async
|
||||||
test('test testEndpointParameters', () async {
|
test('test testEndpointParameters', () async {
|
||||||
@ -123,5 +124,6 @@ void main() {
|
|||||||
test('test testQueryParameterCollectionFormat', () async {
|
test('test testQueryParameterCollectionFormat', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import 'package:test/test.dart';
|
import 'package:test/test.dart';
|
||||||
import 'package:openapi/openapi.dart';
|
import 'package:openapi/openapi.dart';
|
||||||
|
|
||||||
|
|
||||||
/// tests for FakeClassnameTags123Api
|
/// tests for FakeClassnameTags123Api
|
||||||
void main() {
|
void main() {
|
||||||
final instance = Openapi().getFakeClassnameTags123Api();
|
final instance = Openapi().getFakeClassnameTags123Api();
|
||||||
@ -14,5 +15,6 @@ void main() {
|
|||||||
test('test testClassname', () async {
|
test('test testClassname', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -16,5 +16,6 @@ void main() {
|
|||||||
test('to test the property `files`', () async {
|
test('to test the property `files`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,6 @@ void main() {
|
|||||||
test('to test the property `bar`', () async {
|
test('to test the property `bar`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -88,5 +88,6 @@ void main() {
|
|||||||
test('to test the property `patternWithDigitsAndDelimiter`', () async {
|
test('to test the property `patternWithDigitsAndDelimiter`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -16,5 +16,6 @@ void main() {
|
|||||||
test('to test the property `foo`', () async {
|
test('to test the property `foo`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,6 @@ void main() {
|
|||||||
test('to test the property `nullableMessage`', () async {
|
test('to test the property `nullableMessage`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,6 @@ void main() {
|
|||||||
test('to test the property `string`', () async {
|
test('to test the property `string`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -26,5 +26,6 @@ void main() {
|
|||||||
test('to test the property `indirectMap`', () async {
|
test('to test the property `indirectMap`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -21,5 +21,6 @@ void main() {
|
|||||||
test('to test the property `map`', () async {
|
test('to test the property `map`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -16,5 +16,6 @@ void main() {
|
|||||||
test('to test the property `class_`', () async {
|
test('to test the property `class_`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,6 @@ void main() {
|
|||||||
test('to test the property `client`', () async {
|
test('to test the property `client`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -3,5 +3,7 @@ import 'package:openapi/openapi.dart';
|
|||||||
|
|
||||||
// tests for ModelEnumClass
|
// tests for ModelEnumClass
|
||||||
void main() {
|
void main() {
|
||||||
group(ModelEnumClass, () {});
|
|
||||||
|
group(ModelEnumClass, () {
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
@ -12,5 +12,6 @@ void main() {
|
|||||||
test('to test the property `sourceURI`', () async {
|
test('to test the property `sourceURI`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,6 @@ void main() {
|
|||||||
test('to test the property `n123list`', () async {
|
test('to test the property `n123list`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,6 @@ void main() {
|
|||||||
test('to test the property `return_`', () async {
|
test('to test the property `return_`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -26,5 +26,6 @@ void main() {
|
|||||||
test('to test the property `n123number`', () async {
|
test('to test the property `n123number`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -66,5 +66,6 @@ void main() {
|
|||||||
test('to test the property `objectItemsNullable`', () async {
|
test('to test the property `objectItemsNullable`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,6 @@ void main() {
|
|||||||
test('to test the property `justNumber`', () async {
|
test('to test the property `justNumber`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -37,5 +37,6 @@ void main() {
|
|||||||
test('to test the property `complete`', () async {
|
test('to test the property `complete`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -21,5 +21,6 @@ void main() {
|
|||||||
test('to test the property `myBoolean`', () async {
|
test('to test the property `myBoolean`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -3,5 +3,7 @@ import 'package:openapi/openapi.dart';
|
|||||||
|
|
||||||
// tests for OuterEnumDefaultValue
|
// tests for OuterEnumDefaultValue
|
||||||
void main() {
|
void main() {
|
||||||
group(OuterEnumDefaultValue, () {});
|
|
||||||
|
group(OuterEnumDefaultValue, () {
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
@ -3,5 +3,7 @@ import 'package:openapi/openapi.dart';
|
|||||||
|
|
||||||
// tests for OuterEnumIntegerDefaultValue
|
// tests for OuterEnumIntegerDefaultValue
|
||||||
void main() {
|
void main() {
|
||||||
group(OuterEnumIntegerDefaultValue, () {});
|
|
||||||
|
group(OuterEnumIntegerDefaultValue, () {
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
@ -3,5 +3,7 @@ import 'package:openapi/openapi.dart';
|
|||||||
|
|
||||||
// tests for OuterEnumInteger
|
// tests for OuterEnumInteger
|
||||||
void main() {
|
void main() {
|
||||||
group(OuterEnumInteger, () {});
|
|
||||||
|
group(OuterEnumInteger, () {
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
@ -3,5 +3,7 @@ import 'package:openapi/openapi.dart';
|
|||||||
|
|
||||||
// tests for OuterEnum
|
// tests for OuterEnum
|
||||||
void main() {
|
void main() {
|
||||||
group(OuterEnum, () {});
|
|
||||||
|
group(OuterEnum, () {
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,6 @@ void main() {
|
|||||||
test('to test the property `value`', () async {
|
test('to test the property `value`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import 'package:test/test.dart';
|
import 'package:test/test.dart';
|
||||||
import 'package:openapi/openapi.dart';
|
import 'package:openapi/openapi.dart';
|
||||||
|
|
||||||
|
|
||||||
/// tests for PetApi
|
/// tests for PetApi
|
||||||
void main() {
|
void main() {
|
||||||
final instance = Openapi().getPetApi();
|
final instance = Openapi().getPetApi();
|
||||||
@ -74,5 +75,6 @@ void main() {
|
|||||||
test('test uploadFileWithRequiredFile', () async {
|
test('test uploadFileWithRequiredFile', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -37,5 +37,6 @@ void main() {
|
|||||||
test('to test the property `status`', () async {
|
test('to test the property `status`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -16,5 +16,6 @@ void main() {
|
|||||||
test('to test the property `baz`', () async {
|
test('to test the property `baz`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -8,10 +8,9 @@ void main() {
|
|||||||
|
|
||||||
group(SpecialModelName, () {
|
group(SpecialModelName, () {
|
||||||
// int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket
|
// int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket
|
||||||
test(
|
test('to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', () async {
|
||||||
'to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`',
|
|
||||||
() async {
|
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import 'package:test/test.dart';
|
import 'package:test/test.dart';
|
||||||
import 'package:openapi/openapi.dart';
|
import 'package:openapi/openapi.dart';
|
||||||
|
|
||||||
|
|
||||||
/// tests for StoreApi
|
/// tests for StoreApi
|
||||||
void main() {
|
void main() {
|
||||||
final instance = Openapi().getStoreApi();
|
final instance = Openapi().getStoreApi();
|
||||||
@ -39,5 +40,6 @@ void main() {
|
|||||||
test('test placeOrder', () async {
|
test('test placeOrder', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -16,5 +16,6 @@ void main() {
|
|||||||
test('to test the property `name`', () async {
|
test('to test the property `name`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import 'package:test/test.dart';
|
import 'package:test/test.dart';
|
||||||
import 'package:openapi/openapi.dart';
|
import 'package:openapi/openapi.dart';
|
||||||
|
|
||||||
|
|
||||||
/// tests for UserApi
|
/// tests for UserApi
|
||||||
void main() {
|
void main() {
|
||||||
final instance = Openapi().getUserApi();
|
final instance = Openapi().getUserApi();
|
||||||
@ -67,5 +68,6 @@ void main() {
|
|||||||
test('test updateUser', () async {
|
test('test updateUser', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -47,5 +47,6 @@ void main() {
|
|||||||
test('to test the property `userStatus`', () async {
|
test('to test the property `userStatus`', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -9,11 +9,11 @@ import 'dart:async';
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
|
|
||||||
import 'package:openapi/model/pet.dart';
|
|
||||||
import 'package:openapi/model/api_response.dart';
|
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
import 'package:built_collection/built_collection.dart';
|
import 'package:built_collection/built_collection.dart';
|
||||||
import 'package:openapi/api_util.dart';
|
import 'package:openapi/api_util.dart';
|
||||||
|
import 'package:openapi/model/api_response.dart';
|
||||||
|
import 'package:openapi/model/pet.dart';
|
||||||
|
|
||||||
class PetApi {
|
class PetApi {
|
||||||
|
|
||||||
|
@ -9,8 +9,8 @@ import 'dart:async';
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
|
|
||||||
import 'package:openapi/model/order.dart';
|
|
||||||
import 'package:built_collection/built_collection.dart';
|
import 'package:built_collection/built_collection.dart';
|
||||||
|
import 'package:openapi/model/order.dart';
|
||||||
|
|
||||||
class StoreApi {
|
class StoreApi {
|
||||||
|
|
||||||
|
@ -9,8 +9,8 @@ import 'dart:async';
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
|
|
||||||
import 'package:openapi/model/user.dart';
|
|
||||||
import 'package:built_collection/built_collection.dart';
|
import 'package:built_collection/built_collection.dart';
|
||||||
|
import 'package:openapi/model/user.dart';
|
||||||
|
|
||||||
class UserApi {
|
class UserApi {
|
||||||
|
|
||||||
|
@ -9,16 +9,16 @@ import 'dart:async';
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
|
|
||||||
import 'package:openapi/model/file_schema_test_class.dart';
|
|
||||||
import 'package:openapi/model/outer_composite.dart';
|
|
||||||
import 'package:openapi/model/outer_object_with_enum_property.dart';
|
|
||||||
import 'package:openapi/model/user.dart';
|
|
||||||
import 'package:openapi/model/health_check_result.dart';
|
|
||||||
import 'package:openapi/model/pet.dart';
|
|
||||||
import 'package:openapi/model/model_client.dart';
|
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
import 'package:built_collection/built_collection.dart';
|
import 'package:built_collection/built_collection.dart';
|
||||||
import 'package:openapi/api_util.dart';
|
import 'package:openapi/api_util.dart';
|
||||||
|
import 'package:openapi/model/file_schema_test_class.dart';
|
||||||
|
import 'package:openapi/model/health_check_result.dart';
|
||||||
|
import 'package:openapi/model/model_client.dart';
|
||||||
|
import 'package:openapi/model/outer_composite.dart';
|
||||||
|
import 'package:openapi/model/outer_object_with_enum_property.dart';
|
||||||
|
import 'package:openapi/model/pet.dart';
|
||||||
|
import 'package:openapi/model/user.dart';
|
||||||
|
|
||||||
class FakeApi {
|
class FakeApi {
|
||||||
|
|
||||||
|
@ -9,11 +9,11 @@ import 'dart:async';
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
|
|
||||||
import 'package:openapi/model/pet.dart';
|
|
||||||
import 'package:openapi/model/api_response.dart';
|
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
import 'package:built_collection/built_collection.dart';
|
import 'package:built_collection/built_collection.dart';
|
||||||
import 'package:openapi/api_util.dart';
|
import 'package:openapi/api_util.dart';
|
||||||
|
import 'package:openapi/model/api_response.dart';
|
||||||
|
import 'package:openapi/model/pet.dart';
|
||||||
|
|
||||||
class PetApi {
|
class PetApi {
|
||||||
|
|
||||||
|
@ -9,8 +9,8 @@ import 'dart:async';
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
|
|
||||||
import 'package:openapi/model/order.dart';
|
|
||||||
import 'package:built_collection/built_collection.dart';
|
import 'package:built_collection/built_collection.dart';
|
||||||
|
import 'package:openapi/model/order.dart';
|
||||||
|
|
||||||
class StoreApi {
|
class StoreApi {
|
||||||
|
|
||||||
|
@ -9,8 +9,8 @@ import 'dart:async';
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
|
|
||||||
import 'package:openapi/model/user.dart';
|
|
||||||
import 'package:built_collection/built_collection.dart';
|
import 'package:built_collection/built_collection.dart';
|
||||||
|
import 'package:openapi/model/user.dart';
|
||||||
|
|
||||||
class UserApi {
|
class UserApi {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user