-
Notifications
You must be signed in to change notification settings - Fork 23
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
[cli] Import of resources without a validation
creates an unusable python output
#33
Comments
Ha - so it looks like this issue should also be fixed by #44. 😅 By adding "metadata" to all imported CRDs regardless, the generated python class constructors will always have some options you can pass. Here's a snapshot that gives an idea of how the changes in #44 affect the jsii output in Python from my editor: The underlying jsii edge case / bug still exists, but it shouldn't affect imports. |
Yes but - will this allow users to pass in arbitrary specs? or just metadata..? |
Ah I see - if there is no "validation" needed, then we simply want it to allow anything (including both metadata and spec information). This makes sense to me now. 👍 |
I'm taking a closer look now, and it seems like if we want to support arbitrary properties, we probably want to model it in the way And this too is not correctly supported in the Python transliteration, so it looks like in general this is a broader jsii issue. |
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. |
Closing this issue as it hasn't seen activity for a while. Please add a comment @mentioning a maintainer to reopen. |
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. |
Closing this issue as it hasn't seen activity for a while. Please add a comment @mentioning a maintainer to reopen. |
Description of the bug:
When a CRD has no
validation
, the generated python class does not allow passing in any options, meaning you can't configure it.Reproduction Steps:
Save the following CRD in a file:
and run
cdk8s import --language python <file>
The generated python class will look like so:
Notice that the
__init__
method does not accept any options.Alternatively, when generating typescript code, the
Widget
class accepts an empty interface, allowing the user to pass any specification, which is the expected behavior.Error Log:
No error, the generated code is unusable.
Environment:
Other:
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: