-
Notifications
You must be signed in to change notification settings - Fork 75
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
[BUG] (short issue description)Codegen for mocks fails on filename case mismatch. #794
Comments
This issue is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon. If you wish to exclude this issue from being marked as stale, add the "backlog" label. |
Closing this issue as it hasn't seen activity for a while. Please add a comment @mentioning a maintainer to reopen. If you wish to exclude this issue from being marked as stale, add the "backlog" label. |
So ignore it and it will go away? |
Move python infrastructure projects to new codegen. Note that I've duplicated the ejs templates for the async python infrastructure as it's a useful starting point for when async support for python is added. Note that this also fixes #794 by removing the `.lower()` of the full path to the mock json files.
Hey @vaneek! I've just fixed this so it should be addressed when 0.23.62 is released :) Please let me know if you have any issues. Cheers! |
Describe the bug
Using the PDK shopping list demo , the generated code breaks during the build process with the following error;
File "/home/ec2-user/environment/tpdk/packages/api/generated/infrastructure/python/orgapi_python_infra/mock_integrations.py", line 23, in delete_shopping_list_200
infra: with open(path.join(MOCK_DATA_PATH, "DELETE{}-200.json".format("/shopping-list/{shoppingListId}".replace("/", "-")).lower()), "r") as f:
infra: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
infra: FileNotFoundError: [Errno 2] No such file or directory: '/home/ec2-user/environment/tpdk/packages/api/generated/infrastructure/python/orgapi_python_infra/../mocks/delete-shopping-list-{shoppinglistid}-200.json'
The code performs a .lower() on the whole path rather than just the verb. The name of the generated json file is delete-shopping-list-{shoppingListId}-200.json. This may also catch upstream directories with caps in their name.
The smithy definition is;
@http(method: "DELETE", uri: "/shopping-list/{shoppingListId}")
@handler(language: "python")
operation DeleteShoppingList {
input := {
@required
@httpLabel
shoppingListId: ShoppingListId
}
output := with [ShoppingListIdMixin] {}
errors: [NotFoundError]
}
Expected Behavior
Respect actual path/filenames.
Current Behavior
performs a .lower() on path and filename.
Reproduction Steps
Using the PDK shopping list demo
The smithy definition is;
@http(method: "DELETE", uri: "/shopping-list/{shoppingListId}")
@handler(language: "python")
operation DeleteShoppingList {
input := {
@required
@httpLabel
shoppingListId: ShoppingListId
}
output := with [ShoppingListIdMixin] {}
errors: [NotFoundError]
}
Possible Solution
No response
Additional Information/Context
No response
PDK version used
current
What languages are you seeing this issue on?
Python
Environment details (OS name and version, etc.)
AL2023
The text was updated successfully, but these errors were encountered: