Skip to content

Commit

Permalink
Version/2.3.3 (#303)
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

Co-authored-by: uladzimir_paliukhovich <>
Co-authored-by: Elliana May <[email protected]>
  • Loading branch information
Vovanella95 and Mause authored Jan 10, 2022
1 parent df913c2 commit 080f697
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 31 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.3

* Fixed Issue ([#297](https://github.com/epam-cross-platform-lab/swagger-dart-code-generator/issues/297))
* Removed use_inheritance option. Inheritance is supported by copy-pasting parent fields

# 2.3.2

* Fixed Issue ([#290](https://github.com/epam-cross-platform-lab/swagger-dart-code-generator/issues/290))
Expand Down
4 changes: 1 addition & 3 deletions lib/src/code_generators/swagger_models_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1042,8 +1042,6 @@ List<enums.$neededName> ${neededName.camelCase}ListFromJson(
GeneratorOptions options) {
final properties = getModelProperties(map, schemas);

var extendsString = options.useInheritance ? getExtendsString(map) : '';

final generatedConstructorProperties = generateConstructorPropertiesContent(
className,
properties,
Expand Down Expand Up @@ -1079,7 +1077,7 @@ List<enums.$neededName> ${neededName.camelCase}ListFromJson(

final generatedClass = '''
@JsonSerializable(explicitToJson: true)
class $validatedClassName $extendsString{
class $validatedClassName {
\t$validatedClassName($generatedConstructorProperties);\n
\tfactory $validatedClassName.fromJson(Map<String, dynamic> json) => _\$${validatedClassName}FromJson(json);\n
$generatedProperties
Expand Down
4 changes: 0 additions & 4 deletions lib/src/models/generator_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class GeneratorOptions {
this.enumsCaseSensitive = true,
this.useRequiredAttributeForHeaders = true,
this.usePathForRequestNames = true,
this.useInheritance = true,
this.includeIfNull,
this.modelPostfix = '',
this.includePaths = const [],
Expand Down Expand Up @@ -49,9 +48,6 @@ class GeneratorOptions {
@JsonKey(defaultValue: false)
final bool ignoreHeaders;

@JsonKey(defaultValue: true)
final bool useInheritance;

@JsonKey(defaultValue: false)
final bool enumsCaseSensitive;

Expand Down
2 changes: 0 additions & 2 deletions lib/src/models/generator_options.g2.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.2
version: 2.3.3

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
21 changes: 0 additions & 21 deletions test/generator_tests/models_generator_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -679,27 +679,6 @@ void main() {
});
});

group('getModelInheritedProperties', () {
test('Should generate 2 levels of inheritance', () {
final result = generator.generate(model_with_inheritance, 'MyClass',
GeneratorOptions(inputFolder: '', outputFolder: ''));

expect(
result, contains('class ExtendedErrorModel extends BasicErrorModel'));
});

test('Should generate 3 levels of inheritance', () {
final result = generator.generate(model_with_inheritance_3_levels,
'MyClass', GeneratorOptions(inputFolder: '', outputFolder: ''));

expect(result,
contains('class MostExtendedErrorModel extends ExtendedErrorModel'));

expect(
result, contains('class ExtendedErrorModel extends BasicErrorModel'));
});
});

group('Tests for getValidatedClassName', () {
test('Should', () {
final result = SwaggerModelsGenerator.getValidatedClassName('Request');
Expand Down

0 comments on commit 080f697

Please sign in to comment.