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

Thrift service functions optional parameters support #297

Open
kubroid opened this issue Jan 15, 2025 · 0 comments · May be fixed by #298 or cloudwego/volo#545
Open

Thrift service functions optional parameters support #297

kubroid opened this issue Jan 15, 2025 · 0 comments · May be fixed by #298 or cloudwego/volo#545
Assignees
Labels
C-feature-request This is a feature request issue. Implementations of feature requests use `C-enhancement` instead.

Comments

@kubroid
Copy link

kubroid commented Jan 15, 2025

Feature Request

Crates

pilota-build
pilota-thrift-parser

Motivation

    void filters_changed(
        1: string site_id,
        2: optional list<string> filter_names,
    )

The current Thrift definition for the filters_changed method includes an optional parameter filter_names. However, the generated Rust code treats this parameter as if it cannot be None, which leads to inconsistencies and limitations in our implementation.

Specifically, we need the ability to differentiate between cases where filter_names is not provided, is an empty list, or contains specific filter names. This distinction is crucial for handling filtering logic accurately in our application.

Proposal

As @Millione proposed here, treat default parameters as required (current behavior), but optional as optional.

@Millione Millione added the C-feature-request This is a feature request issue. Implementations of feature requests use `C-enhancement` instead. label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request This is a feature request issue. Implementations of feature requests use `C-enhancement` instead.
2 participants