forked from loafle/openapi-generator-original
[dart][core] Fix reservedWordsMappings (#12436)
* [core] Fix naming of reservedWordsMappings * `GeneratorSettings` used a wrong name (missing `s`) which resulted in config loaded from YAMl files not working * [dart] Respect reservedWordsMappings when checking for reserved words
This commit is contained in:
parent
45cbd5f7a7
commit
111675b89b
@ -9,3 +9,5 @@ typeMappings:
|
|||||||
additionalProperties:
|
additionalProperties:
|
||||||
hideGenerationTimestamp: "true"
|
hideGenerationTimestamp: "true"
|
||||||
enumUnknownDefaultCase: "true"
|
enumUnknownDefaultCase: "true"
|
||||||
|
reservedWordsMappings:
|
||||||
|
class: "classField"
|
@ -52,7 +52,7 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
private final Map<String, String> importMappings;
|
private final Map<String, String> importMappings;
|
||||||
private final Map<String, String> inlineSchemaNameMappings;
|
private final Map<String, String> inlineSchemaNameMappings;
|
||||||
private final Set<String> languageSpecificPrimitives;
|
private final Set<String> languageSpecificPrimitives;
|
||||||
private final Map<String, String> reservedWordMappings;
|
private final Map<String, String> reservedWordsMappings;
|
||||||
private final Map<String, String> serverVariables;
|
private final Map<String, String> serverVariables;
|
||||||
|
|
||||||
private String gitHost;
|
private String gitHost;
|
||||||
@ -268,8 +268,8 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
*
|
*
|
||||||
* @return the reserved word mappings
|
* @return the reserved word mappings
|
||||||
*/
|
*/
|
||||||
public Map<String, String> getReservedWordMappings() {
|
public Map<String, String> getReservedWordsMappings() {
|
||||||
return reservedWordMappings;
|
return reservedWordsMappings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -361,7 +361,7 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
importMappings = Collections.unmodifiableMap(builder.importMappings);
|
importMappings = Collections.unmodifiableMap(builder.importMappings);
|
||||||
inlineSchemaNameMappings = Collections.unmodifiableMap(builder.inlineSchemaNameMappings);
|
inlineSchemaNameMappings = Collections.unmodifiableMap(builder.inlineSchemaNameMappings);
|
||||||
languageSpecificPrimitives = Collections.unmodifiableSet(builder.languageSpecificPrimitives);
|
languageSpecificPrimitives = Collections.unmodifiableSet(builder.languageSpecificPrimitives);
|
||||||
reservedWordMappings = Collections.unmodifiableMap(builder.reservedWordMappings);
|
reservedWordsMappings = Collections.unmodifiableMap(builder.reservedWordsMappings);
|
||||||
serverVariables = Collections.unmodifiableMap(builder.serverVariables);
|
serverVariables = Collections.unmodifiableMap(builder.serverVariables);
|
||||||
gitHost = builder.gitHost;
|
gitHost = builder.gitHost;
|
||||||
gitUserId = builder.gitUserId;
|
gitUserId = builder.gitUserId;
|
||||||
@ -432,7 +432,7 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
importMappings = Collections.unmodifiableMap(new HashMap<>(0));
|
importMappings = Collections.unmodifiableMap(new HashMap<>(0));
|
||||||
inlineSchemaNameMappings = Collections.unmodifiableMap(new HashMap<>(0));
|
inlineSchemaNameMappings = Collections.unmodifiableMap(new HashMap<>(0));
|
||||||
languageSpecificPrimitives = Collections.unmodifiableSet(new HashSet<>(0));
|
languageSpecificPrimitives = Collections.unmodifiableSet(new HashSet<>(0));
|
||||||
reservedWordMappings = Collections.unmodifiableMap(new HashMap<>(0));
|
reservedWordsMappings = Collections.unmodifiableMap(new HashMap<>(0));
|
||||||
serverVariables = Collections.unmodifiableMap(new HashMap<>(0));
|
serverVariables = Collections.unmodifiableMap(new HashMap<>(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -488,8 +488,8 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
if (copy.getLanguageSpecificPrimitives() != null) {
|
if (copy.getLanguageSpecificPrimitives() != null) {
|
||||||
builder.languageSpecificPrimitives.addAll(copy.getLanguageSpecificPrimitives());
|
builder.languageSpecificPrimitives.addAll(copy.getLanguageSpecificPrimitives());
|
||||||
}
|
}
|
||||||
if (copy.getReservedWordMappings() != null) {
|
if (copy.getReservedWordsMappings() != null) {
|
||||||
builder.reservedWordMappings.putAll(copy.getReservedWordMappings());
|
builder.reservedWordsMappings.putAll(copy.getReservedWordsMappings());
|
||||||
}
|
}
|
||||||
if (copy.getServerVariables() != null) {
|
if (copy.getServerVariables() != null) {
|
||||||
builder.serverVariables.putAll(copy.getServerVariables());
|
builder.serverVariables.putAll(copy.getServerVariables());
|
||||||
@ -526,7 +526,7 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
private Map<String, String> importMappings;
|
private Map<String, String> importMappings;
|
||||||
private Map<String, String> inlineSchemaNameMappings;
|
private Map<String, String> inlineSchemaNameMappings;
|
||||||
private Set<String> languageSpecificPrimitives;
|
private Set<String> languageSpecificPrimitives;
|
||||||
private Map<String, String> reservedWordMappings;
|
private Map<String, String> reservedWordsMappings;
|
||||||
private Map<String, String> serverVariables;
|
private Map<String, String> serverVariables;
|
||||||
private String gitHost;
|
private String gitHost;
|
||||||
private String gitUserId;
|
private String gitUserId;
|
||||||
@ -544,7 +544,7 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
importMappings = new HashMap<>();
|
importMappings = new HashMap<>();
|
||||||
inlineSchemaNameMappings = new HashMap<>();
|
inlineSchemaNameMappings = new HashMap<>();
|
||||||
languageSpecificPrimitives = new HashSet<>();
|
languageSpecificPrimitives = new HashSet<>();
|
||||||
reservedWordMappings = new HashMap<>();
|
reservedWordsMappings = new HashMap<>();
|
||||||
serverVariables = new HashMap<>();
|
serverVariables = new HashMap<>();
|
||||||
|
|
||||||
gitHost = DEFAULT_GIT_HOST;
|
gitHost = DEFAULT_GIT_HOST;
|
||||||
@ -837,28 +837,28 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the {@code reservedWordMappings} and returns a reference to this Builder so that the methods can be chained together.
|
* Sets the {@code reservedWordsMappings} and returns a reference to this Builder so that the methods can be chained together.
|
||||||
*
|
*
|
||||||
* @param reservedWordMappings the {@code reservedWordMappings} to set
|
* @param reservedWordsMappings the {@code reservedWordsMappings} to set
|
||||||
* @return a reference to this Builder
|
* @return a reference to this Builder
|
||||||
*/
|
*/
|
||||||
public Builder withReservedWordMappings(Map<String, String> reservedWordMappings) {
|
public Builder withReservedWordsMappings(Map<String, String> reservedWordsMappings) {
|
||||||
this.reservedWordMappings = reservedWordMappings;
|
this.reservedWordsMappings = reservedWordsMappings;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a single {@code reservedWordMappings} and returns a reference to this Builder so that the methods can be chained together.
|
* Sets a single {@code reservedWordsMappings} and returns a reference to this Builder so that the methods can be chained together.
|
||||||
*
|
*
|
||||||
* @param key A key for some reserved word mapping
|
* @param key A key for some reserved word mapping
|
||||||
* @param value The value of some reserved word mapping
|
* @param value The value of some reserved word mapping
|
||||||
* @return a reference to this Builder
|
* @return a reference to this Builder
|
||||||
*/
|
*/
|
||||||
public Builder withReservedWordMapping(String key, String value) {
|
public Builder withReservedWordMapping(String key, String value) {
|
||||||
if (this.reservedWordMappings == null) {
|
if (this.reservedWordsMappings == null) {
|
||||||
this.reservedWordMappings = new HashMap<>();
|
this.reservedWordsMappings = new HashMap<>();
|
||||||
}
|
}
|
||||||
this.reservedWordMappings.put(key, value);
|
this.reservedWordsMappings.put(key, value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -966,7 +966,7 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
", additionalProperties=" + additionalProperties +
|
", additionalProperties=" + additionalProperties +
|
||||||
", importMappings=" + importMappings +
|
", importMappings=" + importMappings +
|
||||||
", languageSpecificPrimitives=" + languageSpecificPrimitives +
|
", languageSpecificPrimitives=" + languageSpecificPrimitives +
|
||||||
", reservedWordMappings=" + reservedWordMappings +
|
", reservedWordsMappings=" + reservedWordsMappings +
|
||||||
", gitHost='" + gitHost + '\'' +
|
", gitHost='" + gitHost + '\'' +
|
||||||
", gitUserId='" + gitUserId + '\'' +
|
", gitUserId='" + gitUserId + '\'' +
|
||||||
", gitRepoId='" + gitRepoId + '\'' +
|
", gitRepoId='" + gitRepoId + '\'' +
|
||||||
@ -998,7 +998,7 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
Objects.equals(getImportMappings(), that.getImportMappings()) &&
|
Objects.equals(getImportMappings(), that.getImportMappings()) &&
|
||||||
Objects.equals(getInlineSchemaNameMappings(), that.getInlineSchemaNameMappings()) &&
|
Objects.equals(getInlineSchemaNameMappings(), that.getInlineSchemaNameMappings()) &&
|
||||||
Objects.equals(getLanguageSpecificPrimitives(), that.getLanguageSpecificPrimitives()) &&
|
Objects.equals(getLanguageSpecificPrimitives(), that.getLanguageSpecificPrimitives()) &&
|
||||||
Objects.equals(getReservedWordMappings(), that.getReservedWordMappings()) &&
|
Objects.equals(getReservedWordsMappings(), that.getReservedWordsMappings()) &&
|
||||||
Objects.equals(getGitHost(), that.getGitHost()) &&
|
Objects.equals(getGitHost(), that.getGitHost()) &&
|
||||||
Objects.equals(getGitUserId(), that.getGitUserId()) &&
|
Objects.equals(getGitUserId(), that.getGitUserId()) &&
|
||||||
Objects.equals(getGitRepoId(), that.getGitRepoId()) &&
|
Objects.equals(getGitRepoId(), that.getGitRepoId()) &&
|
||||||
@ -1027,7 +1027,7 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
getImportMappings(),
|
getImportMappings(),
|
||||||
getInlineSchemaNameMappings(),
|
getInlineSchemaNameMappings(),
|
||||||
getLanguageSpecificPrimitives(),
|
getLanguageSpecificPrimitives(),
|
||||||
getReservedWordMappings(),
|
getReservedWordsMappings(),
|
||||||
getGitHost(),
|
getGitHost(),
|
||||||
getGitUserId(),
|
getGitUserId(),
|
||||||
getGitRepoId(),
|
getGitRepoId(),
|
||||||
|
@ -331,7 +331,7 @@ public class CodeGenMojo extends AbstractMojo {
|
|||||||
/**
|
/**
|
||||||
* A map of reserved names and how they should be escaped
|
* A map of reserved names and how they should be escaped
|
||||||
*/
|
*/
|
||||||
@Parameter(name = "reservedWordsMappings", property = "openapi.generator.maven.plugin.reservedWordMappings")
|
@Parameter(name = "reservedWordsMappings", property = "openapi.generator.maven.plugin.reservedWordsMappings")
|
||||||
private List<String> reservedWordsMappings;
|
private List<String> reservedWordsMappings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -70,7 +70,7 @@ public class CodegenConfigurator {
|
|||||||
private Map<String, String> importMappings = new HashMap<>();
|
private Map<String, String> importMappings = new HashMap<>();
|
||||||
private Map<String, String> inlineSchemaNameMappings = new HashMap<>();
|
private Map<String, String> inlineSchemaNameMappings = new HashMap<>();
|
||||||
private Set<String> languageSpecificPrimitives = new HashSet<>();
|
private Set<String> languageSpecificPrimitives = new HashSet<>();
|
||||||
private Map<String, String> reservedWordMappings = new HashMap<>();
|
private Map<String, String> reservedWordsMappings = new HashMap<>();
|
||||||
private Map<String, String> serverVariables = new HashMap<>();
|
private Map<String, String> serverVariables = new HashMap<>();
|
||||||
private String auth;
|
private String auth;
|
||||||
|
|
||||||
@ -118,8 +118,8 @@ public class CodegenConfigurator {
|
|||||||
if(generatorSettings.getLanguageSpecificPrimitives() != null) {
|
if(generatorSettings.getLanguageSpecificPrimitives() != null) {
|
||||||
configurator.languageSpecificPrimitives.addAll(generatorSettings.getLanguageSpecificPrimitives());
|
configurator.languageSpecificPrimitives.addAll(generatorSettings.getLanguageSpecificPrimitives());
|
||||||
}
|
}
|
||||||
if(generatorSettings.getReservedWordMappings() != null) {
|
if(generatorSettings.getReservedWordsMappings() != null) {
|
||||||
configurator.reservedWordMappings.putAll(generatorSettings.getReservedWordMappings());
|
configurator.reservedWordsMappings.putAll(generatorSettings.getReservedWordsMappings());
|
||||||
}
|
}
|
||||||
if(generatorSettings.getServerVariables() != null) {
|
if(generatorSettings.getServerVariables() != null) {
|
||||||
configurator.serverVariables.putAll(generatorSettings.getServerVariables());
|
configurator.serverVariables.putAll(generatorSettings.getServerVariables());
|
||||||
@ -173,7 +173,7 @@ public class CodegenConfigurator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CodegenConfigurator addAdditionalReservedWordMapping(String key, String value) {
|
public CodegenConfigurator addAdditionalReservedWordMapping(String key, String value) {
|
||||||
this.reservedWordMappings.put(key, value);
|
this.reservedWordsMappings.put(key, value);
|
||||||
generatorSettingsBuilder.withReservedWordMapping(key, value);
|
generatorSettingsBuilder.withReservedWordMapping(key, value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -226,9 +226,9 @@ public class CodegenConfigurator {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CodegenConfigurator setReservedWordsMappings(Map<String, String> reservedWordMappings) {
|
public CodegenConfigurator setReservedWordsMappings(Map<String, String> reservedWordsMappings) {
|
||||||
this.reservedWordMappings = reservedWordMappings;
|
this.reservedWordsMappings = reservedWordsMappings;
|
||||||
generatorSettingsBuilder.withReservedWordMappings(reservedWordMappings);
|
generatorSettingsBuilder.withReservedWordsMappings(reservedWordsMappings);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -628,7 +628,7 @@ public class CodegenConfigurator {
|
|||||||
config.importMapping().putAll(generatorSettings.getImportMappings());
|
config.importMapping().putAll(generatorSettings.getImportMappings());
|
||||||
config.inlineSchemaNameMapping().putAll(generatorSettings.getInlineSchemaNameMappings());
|
config.inlineSchemaNameMapping().putAll(generatorSettings.getInlineSchemaNameMappings());
|
||||||
config.languageSpecificPrimitives().addAll(generatorSettings.getLanguageSpecificPrimitives());
|
config.languageSpecificPrimitives().addAll(generatorSettings.getLanguageSpecificPrimitives());
|
||||||
config.reservedWordsMappings().putAll(generatorSettings.getReservedWordMappings());
|
config.reservedWordsMappings().putAll(generatorSettings.getReservedWordsMappings());
|
||||||
config.additionalProperties().putAll(generatorSettings.getAdditionalProperties());
|
config.additionalProperties().putAll(generatorSettings.getAdditionalProperties());
|
||||||
|
|
||||||
Map<String, String> serverVariables = generatorSettings.getServerVariables();
|
Map<String, String> serverVariables = generatorSettings.getServerVariables();
|
||||||
|
@ -146,14 +146,14 @@ public final class CodegenConfiguratorUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void applyReservedWordsMappingsKvpList(List<String> reservedWordMappings, CodegenConfigurator configurator) {
|
public static void applyReservedWordsMappingsKvpList(List<String> reservedWordsMappings, CodegenConfigurator configurator) {
|
||||||
for (String propString : reservedWordMappings) {
|
for (String propString : reservedWordsMappings) {
|
||||||
applyReservedWordsMappingsKvp(propString, configurator);
|
applyReservedWordsMappingsKvp(propString, configurator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void applyReservedWordsMappingsKvp(String reservedWordMappings, CodegenConfigurator configurator) {
|
public static void applyReservedWordsMappingsKvp(String reservedWordsMappings, CodegenConfigurator configurator) {
|
||||||
final Map<String, String> map = createMapFromKeyValuePairs(reservedWordMappings);
|
final Map<String, String> map = createMapFromKeyValuePairs(reservedWordsMappings);
|
||||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||||
configurator.addAdditionalReservedWordMapping(entry.getKey(), entry.getValue());
|
configurator.addAdditionalReservedWordMapping(entry.getKey(), entry.getValue());
|
||||||
}
|
}
|
||||||
|
@ -305,13 +305,18 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
|||||||
|
|
||||||
@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
|
||||||
// a default included type, or a type include through some library
|
// * a keyword
|
||||||
return super.isReservedWord(word) || defaultIncludes().contains(word);
|
// * a word that has been mapped in the reservedWordsMappings
|
||||||
|
// * a default included type or a type include through some library
|
||||||
|
return super.isReservedWord(word) || reservedWordsMappings().containsKey(word) || defaultIncludes().contains(word);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String escapeReservedWord(String name) {
|
public String escapeReservedWord(String name) {
|
||||||
|
if (reservedWordsMappings().containsKey(name)) {
|
||||||
|
return reservedWordsMappings().get(name);
|
||||||
|
}
|
||||||
return name + "_";
|
return name + "_";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import 'package:openapi/api.dart';
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**class_** | **String** | | [optional]
|
**classField** | **String** | | [optional]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import 'package:openapi/api.dart';
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**name** | **int** | | [optional]
|
**name** | **int** | | [optional]
|
||||||
**class_** | **String** | | [optional]
|
**classField** | **String** | | [optional]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -10,10 +10,10 @@ part 'class_model.g.dart';
|
|||||||
/// Model for testing model with \"_class\" property
|
/// Model for testing model with \"_class\" property
|
||||||
///
|
///
|
||||||
/// Properties:
|
/// Properties:
|
||||||
/// * [class_]
|
/// * [classField]
|
||||||
abstract class ClassModel implements Built<ClassModel, ClassModelBuilder> {
|
abstract class ClassModel implements Built<ClassModel, ClassModelBuilder> {
|
||||||
@BuiltValueField(wireName: r'_class')
|
@BuiltValueField(wireName: r'_class')
|
||||||
String? get class_;
|
String? get classField;
|
||||||
|
|
||||||
ClassModel._();
|
ClassModel._();
|
||||||
|
|
||||||
@ -37,10 +37,10 @@ class _$ClassModelSerializer implements StructuredSerializer<ClassModel> {
|
|||||||
Iterable<Object?> serialize(Serializers serializers, ClassModel object,
|
Iterable<Object?> serialize(Serializers serializers, ClassModel object,
|
||||||
{FullType specifiedType = FullType.unspecified}) {
|
{FullType specifiedType = FullType.unspecified}) {
|
||||||
final result = <Object?>[];
|
final result = <Object?>[];
|
||||||
if (object.class_ != null) {
|
if (object.classField != null) {
|
||||||
result
|
result
|
||||||
..add(r'_class')
|
..add(r'_class')
|
||||||
..add(serializers.serialize(object.class_,
|
..add(serializers.serialize(object.classField,
|
||||||
specifiedType: const FullType(String)));
|
specifiedType: const FullType(String)));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -61,7 +61,7 @@ class _$ClassModelSerializer implements StructuredSerializer<ClassModel> {
|
|||||||
case r'_class':
|
case r'_class':
|
||||||
final valueDes = serializers.deserialize(value,
|
final valueDes = serializers.deserialize(value,
|
||||||
specifiedType: const FullType(String)) as String;
|
specifiedType: const FullType(String)) as String;
|
||||||
result.class_ = valueDes;
|
result.classField = valueDes;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,13 +11,13 @@ part 'model200_response.g.dart';
|
|||||||
///
|
///
|
||||||
/// Properties:
|
/// Properties:
|
||||||
/// * [name]
|
/// * [name]
|
||||||
/// * [class_]
|
/// * [classField]
|
||||||
abstract class Model200Response implements Built<Model200Response, Model200ResponseBuilder> {
|
abstract class Model200Response implements Built<Model200Response, Model200ResponseBuilder> {
|
||||||
@BuiltValueField(wireName: r'name')
|
@BuiltValueField(wireName: r'name')
|
||||||
int? get name;
|
int? get name;
|
||||||
|
|
||||||
@BuiltValueField(wireName: r'class')
|
@BuiltValueField(wireName: r'class')
|
||||||
String? get class_;
|
String? get classField;
|
||||||
|
|
||||||
Model200Response._();
|
Model200Response._();
|
||||||
|
|
||||||
@ -47,10 +47,10 @@ class _$Model200ResponseSerializer implements StructuredSerializer<Model200Respo
|
|||||||
..add(serializers.serialize(object.name,
|
..add(serializers.serialize(object.name,
|
||||||
specifiedType: const FullType(int)));
|
specifiedType: const FullType(int)));
|
||||||
}
|
}
|
||||||
if (object.class_ != null) {
|
if (object.classField != null) {
|
||||||
result
|
result
|
||||||
..add(r'class')
|
..add(r'class')
|
||||||
..add(serializers.serialize(object.class_,
|
..add(serializers.serialize(object.classField,
|
||||||
specifiedType: const FullType(String)));
|
specifiedType: const FullType(String)));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -76,7 +76,7 @@ class _$Model200ResponseSerializer implements StructuredSerializer<Model200Respo
|
|||||||
case r'class':
|
case r'class':
|
||||||
final valueDes = serializers.deserialize(value,
|
final valueDes = serializers.deserialize(value,
|
||||||
specifiedType: const FullType(String)) as String;
|
specifiedType: const FullType(String)) as String;
|
||||||
result.class_ = valueDes;
|
result.classField = valueDes;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user