diff --git a/lib/codegen/codegen.dart b/lib/codegen/codegen.dart index eb5bb0ef..5eb60121 100644 --- a/lib/codegen/codegen.dart +++ b/lib/codegen/codegen.dart @@ -1,4 +1,5 @@ import 'package:apidash/codegen/kotlin/pkg_okhttp.dart'; +import 'package:apidash/codegen/python/pkg_request.dart'; import 'package:apidash/consts.dart'; import 'package:apidash/models/models.dart' show RequestModel; @@ -15,6 +16,8 @@ class Codegen { return DartHttpCodeGen().getCode(requestModel, defaultUriScheme); case CodegenLanguage.kotlinOkHttp: return KotlinOkHttpCodeGen().getCode(requestModel); + case CodegenLanguage.pythonRequests: + return PythonRequestCodeGen().getCode(requestModel, defaultUriScheme); default: throw ArgumentError('Invalid codegenLanguage'); } diff --git a/lib/consts.dart b/lib/consts.dart index f1390a3c..ac956bc0 100644 --- a/lib/consts.dart +++ b/lib/consts.dart @@ -230,6 +230,7 @@ const kDefaultContentType = ContentType.json; enum CodegenLanguage { dartHttp("Dart (http)"), + pythonRequests("Python (requests)"), kotlinOkHttp("Kotlin (OkHttp)"); const CodegenLanguage(this.label);