[BUG][dart][dart-dio] "--api-name-suffix" and "--model-name-suffix" options have no effect on generation
Created by: valebedu
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
What's the version of OpenAPI Generator used? -
Have you search for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Bounty to sponsor the fix (example)
Description
openapi-generator version
os: macOS os version: 10.15.2 openapi-generator version: 4.2.3 node version: 10.15.2 npm version: 6.13.4
OpenAPI declaration file content or url
Command line used for generation
npm install
npm run client:generate
with the following package.json
{
"name": "dart-dio-gen",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"client:generate": "rm -rf client/ && openapi-generator generate --generator-name dart-dio --api-name-suffix Api --model-name-suffix ApiModel --input-spec petstore.yaml --output client/"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@openapitools/openapi-generator-cli": "^1.0.10-4.2.3"
}
}
Steps to reproduce
After generation, just have a look at client/model/user.dart
for example
Obtained generate file:
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';
part 'user.g.dart';
abstract class User implements Built<User, UserBuilder> {
@nullable
@BuiltValueField(wireName: r'id')
int get id;
@nullable
@BuiltValueField(wireName: r'username')
String get username;
@nullable
@BuiltValueField(wireName: r'firstName')
String get firstName;
@nullable
@BuiltValueField(wireName: r'lastName')
String get lastName;
@nullable
@BuiltValueField(wireName: r'email')
String get email;
@nullable
@BuiltValueField(wireName: r'password')
String get password;
@nullable
@BuiltValueField(wireName: r'phone')
String get phone;
/* User Status */
@nullable
@BuiltValueField(wireName: r'userStatus')
int get userStatus;
// Boilerplate code needed to wire-up generated code
User._();
factory User([updates(UserBuilder b)]) = _$User;
static Serializer<User> get serializer => _$userSerializer;
}
Expected generated file:
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';
part 'user.g.dart';
abstract class UserApiModel implements Built<UserApiModel, UserBuilder> {
...
// Boilerplate code needed to wire-up generated code
UserApiModel._();
factory UserApiModel([updates(UserApiModelBuilder b)]) = _$UserApiModel;
static Serializer<UserApiModel> get serializer => _$userApiModelSerializer;
}
It looks like --api-name-suffix
and --model-name-suffix
are ignored.