Skip to content

Commit

Permalink
Version/2.3.6 (#312)
Browse files Browse the repository at this point in the history
* Fixed some issues

* Added fix for Field annotations. Updatec changelog and pubspec

* Fixed lot of issues with AllOf support

* Updated changelog and pubspec

* Added requestbodies generation from requests

* Add windows support (#273)

* Run CI on windows too

* chore: Fix a number of path joins

* fix: Revert change to getFileNameWithoutExtension

* fix: Normalize paths used for extensions

* Fixed errors with requestBodies generation

* Added possibility to use operationId for request name

* Format code

* Updated pubspec and changelog

* Fix tests

* Fix analyser issues

* Updated example readme

* Removed converter generator

* Fix cases when refs are overriden

* Fixed enum generation
Changed int64 parsing to double

* Released 2.2.8

* Added support int64

* Updated changelog and pubspec

* Fix for models int64

* Updated changelog and pubspec

* Removed not needed file

* Fixed responses array of int

* Reverted analysis options

* Updated changelog

* Updated version

* Fixed tests

* Fixed analyser issues

* Fixed issue #291

* updated changelog and pubcpec

* Added parsing of security for requests

* Fixed num parsing as Num

* Implemented security keys definition

* Removed not needed prints

* Updated changelog and pubspec

* Removed use_inheritance field

* Removed outdated tests

* Implemented integer enums support

* Updated changelog and pubspec

* Fixed fromJson for integer enum fields

* Updated changelog and pubspec

* Formatted code

* Updated changelog

* Fixed issue 263

* Fixed test

* Fixed issue #311

* Updated pubspec and changelog

Co-authored-by: uladzimir_paliukhovich <>
Co-authored-by: Elliana May <[email protected]>
  • Loading branch information
Vovanella95 and Mause authored Jan 14, 2022
1 parent aac20a4 commit f74d7cb
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 2.3.6

* Fixed Issue ([#311](https://github.com/epam-cross-platform-lab/swagger-dart-code-generator/issues/311))
* Fixed some borded cases in Swagger generator

# 2.3.5

* Fixed Issue ([#263](https://github.com/epam-cross-platform-lab/swagger-dart-code-generator/issues/263))
Expand Down
7 changes: 6 additions & 1 deletion lib/src/code_generators/swagger_enums_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,12 @@ $enumMap

final gemeratedEnumsContent = map.keys
.map((String key) {
final enumValuesMap = map[key] as Map<String, dynamic>;
final enumValues = map[key];

final enumValuesMap = enumValues is Map<String, dynamic>
? enumValues
: <String, dynamic>{};
map[key];

if (enumValuesMap.containsKey('type')) {
return generateEnumContentIfPossible(
Expand Down
25 changes: 17 additions & 8 deletions lib/src/code_generators/swagger_models_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -839,8 +839,12 @@ abstract class SwaggerModelsGenerator {

for (var i = 0; i < propertiesMap.keys.length; i++) {
var propertyName = propertiesMap.keys.elementAt(i);
final propertyEntryMap =
propertiesMap[propertyName] as Map<String, dynamic>;

final propertyEntry = propertiesMap[propertyName];
final propertyEntryMap = propertyEntry is Map<String, dynamic>
? propertyEntry
: <String, dynamic>{};

final propertyKey = propertyName;

final basicTypesMap = generateBasicTypesMapFromSchemas(swagger);
Expand Down Expand Up @@ -1212,10 +1216,12 @@ $allHashComponents;
final refString = allOfRef['\$ref'].toString();
final schema = schemas[refString.getUnformattedRef()];

final moreProperties =
schema['properties'] as Map<String, dynamic>? ?? {};
if (schema != null) {
final moreProperties =
schema['properties'] as Map<String, dynamic>? ?? {};

currentProperties.addAll(moreProperties);
currentProperties.addAll(moreProperties);
}
}

return currentProperties;
Expand Down Expand Up @@ -1303,10 +1309,13 @@ $allHashComponents;
}

properties.forEach((propertyName, propertyValue) {
var property = propertyValue as Map<String, dynamic>;
if (propertyValue is! Map<String, dynamic>) {
return;
}

if (property.containsKey('enum') ||
(property['items'] != null && property['items']['enum'] != null)) {
if (propertyValue.containsKey('enum') ||
(propertyValue['items'] != null &&
propertyValue['items']['enum'] != null)) {
results.add(SwaggerModelsGenerator.getValidatedClassName(
SwaggerEnumsGeneratorV3().generateEnumName(
SwaggerModelsGenerator.getValidatedClassName(className),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: swagger_dart_code_generator

version: 2.3.5
version: 2.3.6

homepage: https://github.com/epam-cross-platform-lab/swagger-dart-code-generator
repository: https://github.com/epam-cross-platform-lab/swagger-dart-code-generator
Expand Down

0 comments on commit f74d7cb

Please sign in to comment.