Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions bin/configs/python-fastapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ templateDir: modules/openapi-generator/src/main/resources/python-fastapi
sourceFolder: "src"
additionalProperties:
hideGenerationTimestamp: "true"
packageVersion: "3.4.5"
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public PythonFastAPIServerCodegen() {
additionalProperties.put("baseSuffix", BASE_CLASS_SUFFIX);
additionalProperties.put(CodegenConstants.SOURCE_FOLDER, DEFAULT_SOURCE_FOLDER);
additionalProperties.put(CodegenConstants.PACKAGE_NAME, DEFAULT_PACKAGE_NAME);
additionalProperties.put(CodegenConstants.PACKAGE_VERSION, DEFAULT_PACKAGE_VERSION);
additionalProperties.put(CodegenConstants.FASTAPI_IMPLEMENTATION_PACKAGE, DEFAULT_IMPL_FOLDER);

languageSpecificPrimitives.add("List");
Expand Down Expand Up @@ -152,6 +153,13 @@ public void processOpts() {

if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME));
} else {
// default to appVersion in the spec
setPackageName((String) additionalProperties.get("appVersion"));
}

if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) {
setPackageVersion((String) additionalProperties.get(CodegenConstants.PACKAGE_VERSION));
}

if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Rx==1.6.1
starlette==0.49.1
typing-extensions==4.13.2
ujson==4.0.2
urllib3==2.6.3
urllib3==2.7.0
uvicorn==0.13.4
uvloop==0.21.0
watchgod==0.7
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = {{packageName}}
version = {{appVersion}}
version = {{packageVersion}}
description = {{appDescription}}
long_description = file: README.md
keywords = OpenAPI {{appName}}
Expand Down
2 changes: 1 addition & 1 deletion samples/server/petstore/python-fastapi/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Rx==1.6.1
starlette==0.49.1
typing-extensions==4.13.2
ujson==4.0.2
urllib3==2.6.3
urllib3==2.7.0
uvicorn==0.13.4
uvloop==0.21.0
watchgod==0.7
Expand Down
2 changes: 1 addition & 1 deletion samples/server/petstore/python-fastapi/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = openapi_server
version = 1.0.0
version = 3.4.5
description = This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
long_description = file: README.md
keywords = OpenAPI OpenAPI Petstore
Expand Down
Loading