Skip to content
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

docgen for python flattens out structs that aren't flattened in codegen #865

Open
iliapolo opened this issue Dec 14, 2022 · 1 comment
Open
Labels
bug This issue is a bug. effort/medium Medium work item – a couple days of effort p1

Comments

@iliapolo
Copy link
Contributor

iliapolo commented Dec 14, 2022

The python documentation generated for this code:

export interface SecretValue {
  readonly secret: ISecret;
  readonly key: string;
}

export interface EnvValueFromSecretOptions {
  readonly optional?: boolean;
}

public static fromSecretValue(secretValue: secret.SecretValue, options: EnvValueFromSecretOptions = {}): EnvValue {
  ...
  ...
}

is this:

cdk8s_plus_25.EnvValue.from_secret_value(
  key: str,
  secret: ISecret,
  optional: bool = None
)

Notice how it flattened the first struct argument, even though its not supposed to. The docs should instead be:

cdk8s_plus_25.EnvValue.from_secret_value(
  secret_value: typing.Union["SecretValue", typing.Dict[builtins.str, typing.Any]],
  optional: bool = None
)

originally discussed here: aws/jsii#3883

@iliapolo iliapolo added bug This issue is a bug. effort/medium Medium work item – a couple days of effort p1 labels Dec 14, 2022
@iliapolo
Copy link
Contributor Author

We can consider dropping the Dict from the signature and just mentioning the SecretValue class to avoid overloading the reader. But in any case the current docs are just wrong and result in a jsii error if used as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. effort/medium Medium work item – a couple days of effort p1
Projects
None yet
Development

No branches or pull requests

1 participant