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

JSii generates an incorrect type in aws_eks (Python) #3070

Closed
1 of 5 tasks
otaviomacedo opened this issue Oct 15, 2021 · 8 comments
Closed
1 of 5 tasks

JSii generates an incorrect type in aws_eks (Python) #3070

otaviomacedo opened this issue Oct 15, 2021 · 8 comments
Assignees
Labels
bug This issue is a bug. cdk-blocker language/python Related to Python bindings module/pacmak Issues affecting the `jsii-pacmak` module p1

Comments

@otaviomacedo
Copy link
Contributor

🐛 Bug Report

Affected Languages

  • TypeScript or Javascript
  • Python
  • Java
  • .NET (C#, F#, ...)
  • Go

General Information

  • JSII Version: 1.39.0 (build 8af72c2), typescript 3.9.10
  • Platform: Darwin Kernel Version 20.4.0: Thu Apr 22 21:46:47 PDT 2021; root:xnu-7195.101.2~1/RELEASE_X86_64 x86_64

What is the problem?

The method EndpointAccess.only_from, from the aws_eks Python module has a parameter cidr of type string. But in the source code, it is an array of string:

class EndpointAccess(
    metaclass=jsii.JSIIMeta,
    jsii_type="@aws-cdk/aws-eks.EndpointAccess",
):
    '''Endpoint access characteristics.'''

    @jsii.member(jsii_name="onlyFrom")
    def only_from(self, *cidr: builtins.str) -> "EndpointAccess":
        '''Restrict public access to specific CIDR blocks.

        If public access is disabled, this method will result in an error.

        :param cidr: CIDR blocks.
        '''
        return typing.cast("EndpointAccess", jsii.invoke(self, "onlyFrom", [*cidr]))

Original bug: aws/aws-cdk#16661

@otaviomacedo otaviomacedo added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 15, 2021
@NGL321 NGL321 added cdk-blocker language/python Related to Python bindings module/pacmak Issues affecting the `jsii-pacmak` module p1 and removed needs-triage This issue or PR still needs to be triaged. labels Jan 7, 2022
@shcherbak
Copy link

we are still suffering of this issue

@otaviomacedo otaviomacedo self-assigned this Apr 25, 2024
@sumupitchayan
Copy link

It also looks like the documentation page shows the incorrect parameter type for cidr in TS:

Screenshot 2024-07-17 at 1 40 36 PM

I believe it should say cidr string[] — CIDR blocks under Parameters instead

@sumupitchayan
Copy link

It looks like it is also incorrect in Java, as the parameter is a String too? Java Docs

@sumupitchayan
Copy link

sumupitchayan commented Aug 27, 2024

Closing as a non-issue.

The method EndpointAccess.only_from, from the aws_eks Python module has a parameter cidr of type string. But in the source code, it is an array of string:

This is incorrect --*cidr: builtins.str in python denotes a variadic string argument, where it accepts multiple strings (where each individual argument is still of type str).

The TS source code you linked also represents the same thing: ...cidr: string[] is a rest parameter that allows the method to accept any number of string arguments.

The docs might be slightly confusing if you haven't encountered variadic arguments before, but it is correct.

Copy link
Contributor

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

@iliapolo
Copy link
Contributor

@sumupitchayan it looks like doc generation is incorrect here, both on the documentation page and on construct hub

Can you check if jsii-docgen already has a bug filed for this? same for the documentation? (documentation page bugs should be filed in the CDK repo).

@sumupitchayan
Copy link

@sumupitchayan it looks like doc generation is incorrect here, both on the documentation page and on construct hub

Can you check if jsii-docgen already has a bug filed for this? same for the documentation? (documentation page bugs should be filed in the CDK repo).

@iliapolo yes there is an issue for exactly this in jsii-docgen, looks like you filed it 😄 #648

I guess we can still mark this issue as closed since we have one in docgen to track this bug.

@iliapolo
Copy link
Contributor

@sumupitchayan we also need to file a bug in the CDK repo regarding the documentation page. Unfortunately it doesn't use jsii-docgen so we'll need to fix in two places.

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. cdk-blocker language/python Related to Python bindings module/pacmak Issues affecting the `jsii-pacmak` module p1
Projects
None yet
Development

No branches or pull requests

5 participants