Skip to content

Commit

Permalink
Development (#695)
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

* Fixed generation of nullable and not nullable fields

* Fixed generation of list parameters with specific names

* Fixed formurlencoded requests

* Revert "Fixed formurlencoded requests"

This reverts commit d103118.

* Updated changelog and pubspec

* formatted code

* Fixed version in changelog

* Added generation of writeOnly and readOnly fields as nullable and no required (Issue 487)

* Fixed generatino of DateTime query parameters (Issue 536)

* Updated pubspec and changelog

---------

Co-authored-by: Uladzimir Paliukhovich <[email protected]>
Co-authored-by: Romain <[email protected]>
  • Loading branch information
3 people authored Dec 15, 2023
1 parent 3a47fe2 commit 0b003b9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 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.4

* Make `readOnly` and `writeOnly` fields as `nullable` and `not required` ([#487](https://github.com/epam-cross-platform-lab/swagger-dart-code-generator/issues/487))
* Added support of `DateTime` query parameters ([#694](https://github.com/epam-cross-platform-lab/swagger-dart-code-generator/issues/694))

# 2.13.3

* Some fixes and improvements
Expand Down
6 changes: 5 additions & 1 deletion lib/src/code_generators/swagger_requests_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ class SwaggerRequestsGenerator extends SwaggerGeneratorBase {
required List<EnumModel> allEnums,
required Map<String, SwaggerRequestParameter> definedParameters,
}) {
final format = parameter.schema?.format ?? '';
final format = parameter.format ?? parameter.schema?.format ?? '';

if (parameter.items?.enumValues.isNotEmpty == true ||
parameter.schema?.enumValues.isNotEmpty == true ||
Expand Down Expand Up @@ -691,6 +691,10 @@ class SwaggerRequestsGenerator extends SwaggerGeneratorBase {
}

String _mapParameterName(String name, String format, String modelPostfix) {
if (name == kString && format == kDateTimeFormat) {
return kDateTimeType;
}

if (name == kArray) {
return 'List?';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ class SwaggerRequestParameter {
this.ref = '',
this.key = '',
this.enumValuesObj = const [],
this.format,
});

@JsonKey(name: 'in', defaultValue: '')
String inParameter;

@JsonKey(name: 'format', defaultValue: null)
String? format;

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

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.3
version: 2.13.4

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 0b003b9

Please sign in to comment.