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

Fix union in header query issue #2189

Merged
merged 19 commits into from
Jan 15, 2024

Conversation

qiaozha
Copy link
Member

@qiaozha qiaozha commented Jan 5, 2024

fixes #2185

@qiaozha
Copy link
Member Author

qiaozha commented Jan 9, 2024

Hold this PR as there's some issues in the modular layer.

@qiaozha
Copy link
Member Author

qiaozha commented Jan 12, 2024

Moving the isKey readOnly logic fix and support named union in Modular layer into this PR.

Copy link
Member

@MaryGao MaryGao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +1525 to +1530
export async function get(
context: Client,
testHeader: "A" | "B",
body: string,
options: GetOptions = { requestOptions: {} },
): Promise<void> {
Copy link
Member Author

@qiaozha qiaozha Jan 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, we actually have response headers returned, but we just return void in the modular layer, I wonder if we should rethink about this a little ? @xirzec @joheredi

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here's the typespec

      op get(
        @header("test-header") testHeader: "A" | "B",
        @body body: string,
      ): { @header("test-header") testHeader: "A" | "B" };

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create an issue #2202 to track this.

@qiaozha qiaozha merged commit 50e8c75 into Azure:main Jan 15, 2024
28 checks passed
@qiaozha
Copy link
Member Author

qiaozha commented Jan 15, 2024

We can fix remaining issue in other PRs.

@qiaozha qiaozha deleted the fix-union-in-header-query-issue branch January 15, 2024 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Named Union Type Not Emitted In Generated Code
4 participants