Skip to content

Commit 7c048e4

Browse files
authored
statically set generated date and date-time example value (#901)
1 parent 6c12cd7 commit 7c048e4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/docusaurus-plugin-openapi-docs/src/openapi/createRequestExample.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ const primitives: Primitives = {
3030
string: {
3131
default: () => "string",
3232
email: () => "[email protected]",
33-
date: () => new Date().toISOString().substring(0, 10),
34-
"date-time": () => new Date().toISOString(),
33+
date: () => "2024-07-29",
34+
"date-time": () => "2024-07-29T15:51:28.071Z",
3535
uuid: () => "3fa85f64-5717-4562-b3fc-2c963f66afa6",
3636
hostname: () => "example.com",
3737
ipv4: () => "198.51.100.42",

packages/docusaurus-plugin-openapi-docs/src/openapi/createResponseExample.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ const primitives: Primitives = {
3030
string: {
3131
default: () => "string",
3232
email: () => "[email protected]",
33-
date: () => new Date().toISOString().substring(0, 10),
34-
"date-time": () => new Date().toISOString(),
33+
date: () => "2024-07-29",
34+
"date-time": () => "2024-07-29T15:51:28.071Z",
3535
uuid: () => "3fa85f64-5717-4562-b3fc-2c963f66afa6",
3636
hostname: () => "example.com",
3737
ipv4: () => "198.51.100.42",

0 commit comments

Comments
 (0)