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 the query datetime support issue #1884

Merged
merged 2 commits into from
Jun 13, 2023
Merged

Conversation

MaryGao
Copy link
Member

@MaryGao MaryGao commented Jun 13, 2023

Generate the datetime as Date | string when the parameter is in query & model property, as string in header.

@MaryGao MaryGao marked this pull request as ready for review June 13, 2023 03:08
import { RequestParameters } from "@azure-rest/core-client";

export interface TestHeaders {
"execution-to"?: string;
Copy link
Member

Choose a reason for hiding this comment

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

why is this different with what has been defined in the typespec ?

Copy link
Member Author

@MaryGao MaryGao Jun 13, 2023

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

@timotheeguerin Hi, do you have any context on this ? The only document I can found about header is that they are case insensitive, but it doesn't say this dash mark can also be ignored. https://datatracker.ietf.org/doc/html/rfc7230#section-3.2

Copy link
Member

Choose a reason for hiding this comment

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

The header decorator automatically convert camelCase to camel-case as the header value if you don’t specify an explicit value

Copy link
Member

Choose a reason for hiding this comment

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

Is this documented somewhere? I mean in TypeSpec documentation.

Copy link
Member

Choose a reason for hiding this comment

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

I thought we did but I can't seem to find it. Will create an issue

@MaryGao MaryGao merged commit 6e99089 into Azure:main Jun 13, 2023
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.

3 participants