Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #732

Merged
merged 115 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
2c826d8
Fixed some issues
Jun 7, 2023
f064936
formatted code
Jun 7, 2023
352d09f
updated SDK
Jun 7, 2023
861dfac
Updated SDK and version
Jun 7, 2023
d320f12
Fixed generation of lists of classes
Jun 7, 2023
fbda249
Fixed generation $Items classes
Jun 7, 2023
1ade0c7
Updated pubspec and changelog
Jun 7, 2023
fe41f12
Fixed #524
Jun 9, 2023
173d9aa
Fixed #598 Generation of query enum parameters
Jun 23, 2023
a09e442
Merge branch 'master' into version/2.11.6
Jun 23, 2023
16b5e3f
Fixed conflicts
Jun 23, 2023
d1c7d2f
Fixed some issues in swaggers
Jul 5, 2023
6ae1b7d
Updated changelog and pubspec
Jul 5, 2023
ff4d14e
Fix #583, #637, #619 and update readme (#638)
romainboucher Sep 8, 2023
3466b48
Merge branch 'master' into version/2.11.6
Sep 8, 2023
290deb0
Fixed generation of some fields
Sep 22, 2023
d3a77eb
Removed test
Sep 22, 2023
8283674
Fixed classes named List
Sep 22, 2023
a71a9e9
Fixed generation of query parameters with ref default type
Sep 22, 2023
dead103
Merge branch 'master' into version/2.11.6
Sep 22, 2023
d99e4f9
Fixed generation of DateTime parameters
Sep 22, 2023
e2fe57f
Fixed generation of responses in some cases
Sep 22, 2023
8e8c5ff
Merge branch 'master' into version/2.11.6
Sep 22, 2023
1b24515
Some fixes
Sep 22, 2023
4bdd297
Updated changelog and pubspec
Sep 22, 2023
b974025
Merge branch 'master' into version/2.11.6
Sep 22, 2023
3e6c745
Implemented not nullable fields
Sep 29, 2023
bc0c305
Fixed tests
Sep 29, 2023
0ed9163
fixed generation of some swaggers
Oct 13, 2023
baec549
Added ability to return String values
Oct 13, 2023
fdc496a
Merge branch 'master' into development
Oct 13, 2023
899833e
Returned main.dart content
Oct 13, 2023
1eabeb0
Updated pubspec and changelog
Oct 13, 2023
360b837
Fixed generation of required and not required fields
Oct 20, 2023
6c2f1a7
Added check for object ref in body
Oct 20, 2023
e973370
Fixed some things
Oct 20, 2023
4fa3a11
Fixed tests
Oct 20, 2023
7896617
Fixed tests
Oct 20, 2023
22af9f0
Fixed some things
Oct 20, 2023
ddf6b4c
Updated changelog and pubspec
Oct 20, 2023
66dba04
Removed not needed lines in tests
Oct 20, 2023
8fcfbb0
Fixed generation of nullable responses
Nov 1, 2023
7448d28
Added generation of DateTime
Nov 1, 2023
c8c3522
Updated pubspec and changelog
Nov 1, 2023
d7a06b2
Merge branch 'master' into development
Nov 1, 2023
4c7f4df
Fixed tests
Nov 1, 2023
6b9e104
Fixed #669 Generation models from content schema allof
Nov 10, 2023
c191faf
Fixed #665 generation putIfAbsent for response from content schema
Nov 10, 2023
f37ea45
Merge branch 'master' into development
Nov 10, 2023
313cea9
Fixed generation of nullable and required properties
Nov 10, 2023
cc170ce
Merge branch 'master' into development
Nov 10, 2023
74bd541
Fixed tests
Nov 10, 2023
07421ca
Fixed some stuff related to nullable properties
Nov 10, 2023
d19f042
Updated changelog and pubspec
Nov 10, 2023
82db0eb
Formatted code
Nov 10, 2023
ecb17c4
Merge branch 'master' into development
Nov 10, 2023
7719589
Formatted code
Nov 10, 2023
d277030
Fixed tests
Nov 10, 2023
73db345
Fixed generation of some enums inside classes
Nov 17, 2023
fb2242c
Implemented support of exploded parameters
Nov 17, 2023
649e129
Merge branch 'master' into development
Nov 17, 2023
8c1fe97
Pushed constants file
Nov 17, 2023
48dfe4a
Fixed generation of allOf for request bodies
Nov 22, 2023
15c58ba
Merge branch 'master' into development
Nov 22, 2023
1158b4b
Implemented overriden_models functionality
Nov 22, 2023
0201193
Improved overriden models logic
Nov 22, 2023
cbcc034
Fixed tests
Nov 22, 2023
1a20bf3
Updated pubspec and changelog
Nov 22, 2023
2197841
Merge branch 'master' into development
Nov 22, 2023
70a6665
Removed support of exploded parameters
Nov 22, 2023
a1fb0e5
Fixed generation of patameters contains keywords
Dec 1, 2023
29a517c
Updated pubspec and changelog
Dec 1, 2023
86336bc
Merge branch 'master' into development
Dec 1, 2023
0e1e110
Fixed generation of nullable and not nullable fields
Dec 1, 2023
285fdc3
Merge branch 'master' into development
Dec 1, 2023
41b4fbd
Fixed generation of list parameters with specific names
Dec 1, 2023
b050bf6
Merge branch 'master' into development
Dec 1, 2023
d103118
Fixed formurlencoded requests
Dec 1, 2023
6a433b7
Revert "Fixed formurlencoded requests"
Dec 1, 2023
0644fc2
Merge branch 'master' into development
Dec 8, 2023
a472fa4
Updated changelog and pubspec
Dec 8, 2023
8e7a9a1
formatted code
Dec 8, 2023
d464b68
Fixed version in changelog
Dec 8, 2023
f07c5c5
Added generation of writeOnly and readOnly fields as nullable and no …
Dec 15, 2023
7992d75
Fixed generatino of DateTime query parameters (Issue 536)
Dec 15, 2023
cdb6d34
Merge branch 'master' into development
Dec 15, 2023
e86556c
Updated pubspec and changelog
Dec 15, 2023
de96f5e
Fixed generation in some cases
Dec 15, 2023
0ff2ac3
Merge branch 'development'
Dec 15, 2023
0bc3f58
Added ability to rename downloaded files
Dec 22, 2023
669d5b2
Updated example
Dec 22, 2023
bea1553
Merge branch 'master' into development
Dec 22, 2023
8b27c97
Implemented support of deprecated fields annotations
Dec 29, 2023
4e2b462
Added support of deprecated requests annotations
Dec 29, 2023
5c63e1a
Merge branch 'master' into development
Dec 29, 2023
28b606b
Fixed tests, updated pubspec and changelog
Dec 29, 2023
eeacf5e
Fixed putIfAbsent for allOf schemas #700
Dec 29, 2023
2c518e4
Fixed tests
Dec 29, 2023
b3bf10e
Implemented new build option
Jan 5, 2024
75d248d
Some fixes
Jan 5, 2024
99e9192
Implemented new generator option
Jan 5, 2024
8d0ef52
Updated changelog, readme and pubspec
Jan 5, 2024
8839ce9
Merge branch 'master' into development
Jan 5, 2024
3bae56f
Fixed conflicts
Jan 5, 2024
2b57fc1
Fixed generation of requestBody when one oneOf provided
Jan 23, 2024
314f464
Merge branch 'master' into development
Jan 24, 2024
77f17cb
Added override keyword to exceptionWords
Jan 24, 2024
b61b613
Fixed generation of allOf models
Jan 24, 2024
cb6dda8
Revert "Fixed generation of allOf models"
Jan 29, 2024
15a1ee0
Updated pubspec and changelog
Jan 29, 2024
4b4c461
Merge branch 'master' into development
Jan 29, 2024
692fbdb
Updated changelog
Jan 29, 2024
324bd5c
Fixed #722 generation of some files
Mar 5, 2024
73708d3
Fixed generation of quoted in enum names
Mar 5, 2024
10aa6de
Fixed generation of some requests with enums
Mar 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lib/src/code_generators/enum_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ class EnumModel {
@override
String toString() => _getEnumContent();

static String _normalizeJsonKeyString(String jsonKey) {
return jsonKey.replaceAll("\$", "\\\$").replaceAll('\'', '\\\'');
}

String _getEnumContent() {
final resultStrings = <String>[];

Expand All @@ -42,10 +46,10 @@ class EnumModel {

if (isInteger) {
resultStrings.add(
"\t@JsonValue(${value.replaceAll("\$", "\\\$")})\n\t$validatedValue");
"\t@JsonValue(${_normalizeJsonKeyString(value)})\n\t$validatedValue");
} else {
resultStrings.add(
"\t@JsonValue('${value.replaceAll("\$", "\\\$")}')\n\t$validatedValue");
"\t@JsonValue('${_normalizeJsonKeyString(value)}')\n\t$validatedValue");
}
}

Expand Down Expand Up @@ -97,7 +101,7 @@ const $name(this.value);
result = '\$$result';
}

return '$result(${isInteger ? fieldValue : '\'$fieldValue\''})';
return '$result(${isInteger ? fieldValue : '\'${_normalizeJsonKeyString(fieldValue)}\''})';
}

String generateFromJsonToJson([bool caseSensitive = true]) {
Expand Down
3 changes: 2 additions & 1 deletion lib/src/code_generators/swagger_models_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1646,7 +1646,8 @@ $allHashComponents;

final newModelMap = allOf.firstWhereOrNull((m) => m.properties.isNotEmpty);

final currentProperties = schema.properties;
final currentProperties =
Map<String, SwaggerSchema>.from(schema.properties);

currentProperties.addAll(newModelMap?.properties ?? {});

Expand Down
2 changes: 1 addition & 1 deletion lib/src/code_generators/swagger_requests_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ class SwaggerRequestsGenerator extends SwaggerGeneratorBase {
return getValidatedClassName(neededKey).asEnum();
}

if (parameter.type == kArray) {
if (parameter.type == kArray || parameter.schema?.type == kArray) {
final result = _getEnumParameterTypeName(
parameterName: parameter.name,
path: path,
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.14.2
version: 2.15.0

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
Loading