Skip to content

Commit

Permalink
Development (#689)
Browse files Browse the repository at this point in the history
* Fixed some issues

* formatted code

* updated SDK

* Updated SDK and version

* Fixed generation of lists of classes

* Fixed generation $Items classes

* Updated pubspec and changelog

* Fixed #524

* Fixed #598 Generation of query enum parameters

* Fixed conflicts

* Fixed some issues in swaggers

* Updated changelog and pubspec

* Fix #583, #637, #619 and update readme (#638)

* fix #583 and update readme

* fix #637

* fix #619

* Fixed generation of some fields

* Removed test

* Fixed classes named List

* Fixed generation of query parameters with ref default type

* Fixed generation of DateTime parameters

* Fixed generation of responses in some cases

* Some fixes

* Updated changelog and pubspec

* Implemented not nullable fields

* Fixed tests

* fixed generation of some swaggers

* Added ability to return String values

* Returned main.dart content

* Updated pubspec and changelog

* Fixed generation of required and not required fields

* Added check for object ref in body

* Fixed some things

* Fixed tests

* Fixed tests

* Fixed some things

* Updated changelog and pubspec

* Removed not needed lines in tests

* Fixed generation of nullable responses

* Added generation of DateTime

* Updated pubspec and changelog

* Fixed tests

* Fixed #669 Generation models from content schema allof

* Fixed #665 generation putIfAbsent for response from content schema

* Fixed generation of nullable and required properties

* Fixed tests

* Fixed some stuff related to nullable properties

* Updated changelog and pubspec

* Formatted code

* Formatted code

* Fixed tests

* Fixed generation of some enums inside classes

* Implemented support of exploded parameters

* Pushed constants file

* Fixed generation of allOf for request bodies

* Implemented overriden_models functionality

* Improved overriden models logic

* Fixed tests

* Updated pubspec and changelog

* Removed support of exploded parameters

* Fixed generation of patameters contains keywords

* Updated pubspec and changelog

---------

Co-authored-by: Uladzimir Paliukhovich <uladzimir_paliukhovich@epam.com>
Co-authored-by: Romain <romain@rb-dev.fr>
  • Loading branch information
3 people committed Dec 1, 2023
1 parent f39dc43 commit 18dda94
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 28 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 2.13.2

* Fixed generation key word parameter names ([#685](https://github.com/epam-cross-platform-lab/swagger-dart-code-generator/issues/685))


# 2.13.1

* ***Breaking*** Changed Overriden Models usage ([#550](https://github.com/epam-cross-platform-lab/swagger-dart-code-generator/issues/550))
Expand Down
1 change: 0 additions & 1 deletion lib/src/code_generators/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ const kArray = 'array';
const kEnum = 'enum';
const kBody = 'body';
const kQuery = 'query';
const kExplodedQuery ='ExplodedQuery';
const kPartFile = 'partFile';
const kPart = 'part';

Expand Down
21 changes: 1 addition & 20 deletions lib/src/code_generators/swagger_requests_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -390,13 +390,6 @@ class SwaggerRequestsGenerator extends SwaggerGeneratorBase {
}
}

if (p.annotations.first.code
.toString()
.contains('symbol=ExplodedQuery')) {
result = result.copyWith(
annotations: [refer('Query()')], type: Reference('String?'));
}

return result;
});

Expand Down Expand Up @@ -434,11 +427,6 @@ class SwaggerRequestsGenerator extends SwaggerGeneratorBase {
List<String> allModels,
) {
final parametersListString = parameters.map((p) {
final isExposed = p.annotations.firstOrNull?.code
.toString()
.contains('symbol=ExplodedQuery') ??
false;

if (p.type!.symbol!.startsWith('enums.')) {
return '${p.name} : ${p.name}?.value?.toString()';
}
Expand All @@ -457,11 +445,7 @@ class SwaggerRequestsGenerator extends SwaggerGeneratorBase {
final typeName = p.type!.symbol!;
final name = typeName.substring(11, typeName.length - 2).camelCase;

if (isExposed) {
return '${p.name} : ${name}ExplodedListToJson(${p.name})';
} else {
return '${p.name} : ${name}ListToJson(${p.name})';
}
return '${p.name} : ${name}ListToJson(${p.name})';
}

return '${p.name} : ${p.name}';
Expand Down Expand Up @@ -547,9 +531,6 @@ class SwaggerRequestsGenerator extends SwaggerGeneratorBase {
.call([literalString(parameter.name.replaceAll('\$', ''))]);
case kBody:
return refer(kBody.pascalCase).call([]);
case kQuery:
return refer(parameter.explode ? kExplodedQuery : kQuery.pascalCase)
.call([]);
default:
//https://github.com/lejard-h/chopper/issues/295
return refer(parameter.inParameter.pascalCase)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class SwaggerRequestParameter {
this.schema,
this.ref = '',
this.key = '',
this.explode = false,
this.enumValuesObj = const [],
});

Expand All @@ -29,9 +28,6 @@ class SwaggerRequestParameter {
@JsonKey(name: 'name', defaultValue: '')
String name;

@JsonKey(name: 'explode', defaultValue: false)
bool explode;

@JsonKey(name: 'description', defaultValue: '')
String description;

Expand Down

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.13.1
version: 2.13.2

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 18dda94

Please sign in to comment.