docs
docs copied to clipboard
Why is there a mix beween camelcase and underscores for variable names?
File: docs/reference/pkg/azure/network/networkinterface.md
It's inconsistent and not proper code style imo. See privateIpAddressAllocation and privateIpAddressVersion
I think this probably refers to Python. I agree, this doesn't look quite right to me either. See for instance https://www.pulumi.com/docs/reference/pkg/azure/network/networkinterface/#networkinterfaceipconfiguration:

Thanks, for opening the issue, @aardbol.
Totally agree this doesn't look right. Unfortunately, it's a consequence of https://github.com/pulumi/pulumi/issues/3151. We automatically map camelCase names to snake_case for Python dicts, but we have a bug in the way the mapping was originally implemented, where only top-level resource property names are included in the mapping tables. Properties of nested types may or may not be mapped correctly, depending on whether the name is present in the mapping tables. The documentation is reflecting what the names should be given the current less-than-ideal behavior.
We've kept the current behavior to maintain compatibility for existing programs, but this is an area where we're making some big improvements rolling out the next couple of weeks. https://github.com/pulumi/pulumi/issues/3771 tracks the work we're doing to generate proper input/output classes for Python. Instead of passing nested structures as dicts (as you must do today, and which may require the use of camelCase keys), you can opt-in to using the new input classes, which have __init__ args and Python properties that always use the correct snake_casing. And for nested outputs, the new output classes have getter properties that also always use the correct snake_casing. Once these changes roll out, we'll be updating our docs to reflect the proper snake_casing throughout.
The input/output classes should largely help address this, but we're still considering addressing https://github.com/pulumi/pulumi/issues/3151 (potentially adding an a flag to opt-in to disabling the mapping behavior, and longer term, making it the default behavior, with flag to opt-out, in a major version bump).