Skip to content

Commit

Permalink
fix-offset-datetime-in-rlc (Azure#2031)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaozha authored and jeremymeng committed Sep 27, 2023
1 parent 5d8fe88 commit 9e79a6e
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export interface ErrorDetailsOutput {

// @public
export interface FileInfo {
expireDateTime?: Date | string;
expireDateTime?: string;
fileName?: string;
fileType?: string;
url?: string;
Expand Down Expand Up @@ -576,8 +576,8 @@ export interface LoadTestAdministrationListTestsQueryParam {

// @public (undocumented)
export interface LoadTestAdministrationListTestsQueryParamProperties {
lastModifiedEndTime?: Date | string;
lastModifiedStartTime?: Date | string;
lastModifiedEndTime?: string;
lastModifiedStartTime?: string;
maxpagesize?: number;
orderby?: string;
search?: string;
Expand Down Expand Up @@ -1155,8 +1155,8 @@ export interface LoadTestRunListTestRunsQueryParam {

// @public (undocumented)
export interface LoadTestRunListTestRunsQueryParamProperties {
executionFrom?: Date | string;
executionTo?: Date | string;
executionFrom?: string;
executionTo?: string;
maxpagesize?: number;
orderby?: string;
search?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export interface FileInfo {
*/
fileType?: string;
/** Expiry time of the file (ISO 8601 literal format) */
expireDateTime?: Date | string;
expireDateTime?: string;
/**
* Validation status of the file
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ export interface LoadTestAdministrationListTestsQueryParamProperties {
* Start DateTime(ISO 8601 literal format) of the last updated time range to
* filter tests.
*/
lastModifiedStartTime?: Date | string;
lastModifiedStartTime?: string;
/**
* End DateTime(ISO 8601 literal format) of the last updated time range to filter
* tests.
*/
lastModifiedEndTime?: Date | string;
lastModifiedEndTime?: string;
/** Number of results in response. */
maxpagesize?: number;
}
Expand Down Expand Up @@ -190,9 +190,9 @@ export interface LoadTestRunListTestRunsQueryParamProperties {
/** Unique name of an existing load test. */
testId?: string;
/** Start DateTime(ISO 8601 literal format) of test-run execution time filter range. */
executionFrom?: Date | string;
executionFrom?: string;
/** End DateTime(ISO 8601 literal format) of test-run execution time filter range. */
executionTo?: Date | string;
executionTo?: string;
/** Comma separated list of test run status. */
status?: string;
/** Number of results in response. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export interface FileInfo {
*/
fileType?: string;
/** Expiry time of the file (ISO 8601 literal format) */
expireDateTime?: Date | string;
expireDateTime?: string;
/**
* Validation status of the file
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ export interface LoadTestAdministrationListTestsQueryParamProperties {
* Start DateTime(ISO 8601 literal format) of the last updated time range to
* filter tests.
*/
lastModifiedStartTime?: Date | string;
lastModifiedStartTime?: string;
/**
* End DateTime(ISO 8601 literal format) of the last updated time range to filter
* tests.
*/
lastModifiedEndTime?: Date | string;
lastModifiedEndTime?: string;
/** Number of results in response. */
maxpagesize?: number;
}
Expand Down Expand Up @@ -190,9 +190,9 @@ export interface LoadTestRunListTestRunsQueryParamProperties {
/** Unique name of an existing load test. */
testId?: string;
/** Start DateTime(ISO 8601 literal format) of test-run execution time filter range. */
executionFrom?: Date | string;
executionFrom?: string;
/** End DateTime(ISO 8601 literal format) of test-run execution time filter range. */
executionTo?: Date | string;
executionTo?: string;
/** Comma separated list of test run status. */
status?: string;
/** Number of results in response. */
Expand Down
2 changes: 1 addition & 1 deletion packages/typespec-ts/src/utils/modelUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ function getSchemaForStdScalar(
type: "string",
format: "date-time",
description,
typeName: "Date | string",
typeName: "string",
outputTypeName: "string"
};
case "plainTime":
Expand Down
4 changes: 2 additions & 2 deletions packages/typespec-ts/test/unit/modelsGenerator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ describe("Input/output model type", () => {
});

it("should handle offsetDateTime -> string in output model & `Date | string` in input model", async () => {
const inputType = "Date | string";
const inputType = "string";
const outputType = "string";
await verifyPropertyType("offsetDateTime ", inputType, {
outputType
Expand Down Expand Up @@ -1111,7 +1111,7 @@ describe("Input/output model type", () => {
inputModelFile?.content!,
`
export interface SimpleModel {
"createdAt": Date | string;
"createdAt": string;
}
`
);
Expand Down
4 changes: 2 additions & 2 deletions packages/typespec-ts/test/unit/parametersGenerator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe("Parameters.ts", () => {
);
});

it("should generate offsetDateTime as Date | string", async () => {
it("should generate offsetDateTime as string", async () => {
const parameters = await emitParameterFromTypeSpec(
`
model QueryParameter {
Expand All @@ -104,7 +104,7 @@ describe("Parameters.ts", () => {
import { RequestParameters } from "@azure-rest/core-client";
export interface TestQueryParamProperties {
executionTo?: Date | string;
executionTo?: string;
}
export interface TestQueryParam {
Expand Down

0 comments on commit 9e79a6e

Please sign in to comment.