Skip to content

Commit 3577a0b

Browse files
authored
Fix/revert pr224 (#304)
* chore: exclude devcontainer dir * test: demonstrate failure * test: remove -p test * fix: oas2tson handles FooBARBaz (added to example spec) * fix: remove formatFilename and deps * chore: remove devcontiner from .gitignore (manually excluded) * fix: add output files (including FooBARBaz) * fix: add package-lock.json
1 parent d0d8bf8 commit 3577a0b

24 files changed

+272
-320
lines changed

example/openapi.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,8 +771,13 @@ components:
771771
type: string
772772
message:
773773
type: string
774+
FooBARBaz:
775+
$ref: '#/components/schemas/FooBARBaz'
774776
xml:
775777
name: '##default'
778+
FooBARBaz:
779+
type: string
780+
description: this name is valid and should be FooBARBaz everywhere it appears
776781
requestBodies:
777782
Pet:
778783
description: Pet object that needs to be added to the store

example/output/json/components.schemas/ApiResponse.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
},
1313
"message": {
1414
"type": "string"
15+
},
16+
"FooBARBaz": {
17+
"$ref": "FooBARBaz.json"
1518
}
1619
},
1720
"title": "ApiResponse",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "string",
3+
"description": "this name is valid and should be FooBARBaz everywhere it appears",
4+
"title": "FooBARBaz",
5+
"$id": "FooBARBaz.json"
6+
}

example/output/ts/ApiResponse.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ export const ApiResponse = {
99
},
1010
type: { type: "string" },
1111
message: { type: "string" },
12+
FooBARBaz: {
13+
type: "string",
14+
description:
15+
"this name is valid and should be FooBARBaz everywhere it appears",
16+
title: "FooBARBaz",
17+
$id: "FooBARBaz.json",
18+
},
1219
},
1320
title: "ApiResponse",
1421
$id: "ApiResponse.json",

example/output/ts/FooBARBaz.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export const FooBARBaz = {
2+
type: "string",
3+
description:
4+
"this name is valid and should be FooBARBaz everywhere it appears",
5+
title: "FooBARBaz",
6+
$id: "FooBARBaz.json",
7+
} as const;

example/output/tson/Address.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export const Address = {
2+
type: "object",
3+
properties: {
4+
street: { type: "string" },
5+
city: { type: "string" },
6+
state: { type: "string" },
7+
zip: { type: "string" },
8+
},
9+
title: "Address",
10+
$id: "Address.json",
11+
} as const;

example/output/tson/ApiResponse.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
export const ApiResponse = {
2+
type: "object",
3+
properties: {
4+
code: {
5+
type: "integer",
6+
format: "int32",
7+
minimum: -2147483648,
8+
maximum: 2147483647,
9+
},
10+
type: { type: "string" },
11+
message: { type: "string" },
12+
FooBARBaz: {
13+
type: "string",
14+
description:
15+
"this name is valid and should be FooBARBaz everywhere it appears",
16+
title: "FooBARBaz",
17+
$id: "FooBARBaz.json",
18+
},
19+
},
20+
title: "ApiResponse",
21+
$id: "ApiResponse.json",
22+
} as const;

example/output/tson/Category.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export const Category = {
2+
type: "object",
3+
properties: {
4+
id: {
5+
type: "integer",
6+
format: "int64",
7+
minimum: -9223372036854776000,
8+
maximum: 9223372036854776000,
9+
},
10+
name: { type: "string" },
11+
},
12+
title: "Category",
13+
$id: "Category.json",
14+
} as const;

example/output/tson/Customer.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
export const Customer = {
2+
type: "object",
3+
properties: {
4+
id: {
5+
type: "integer",
6+
format: "int64",
7+
minimum: -9223372036854776000,
8+
maximum: 9223372036854776000,
9+
},
10+
username: { type: "string" },
11+
address: {
12+
type: "array",
13+
items: {
14+
type: "object",
15+
properties: {
16+
street: { type: "string" },
17+
city: { type: "string" },
18+
state: { type: "string" },
19+
zip: { type: "string" },
20+
},
21+
title: "Address",
22+
$id: "Address.json",
23+
},
24+
},
25+
},
26+
title: "Customer",
27+
$id: "Customer.json",
28+
} as const;

example/output/tson/FooBARBaz.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export const FooBARBaz = {
2+
type: "string",
3+
description:
4+
"this name is valid and should be FooBARBaz everywhere it appears",
5+
title: "FooBARBaz",
6+
$id: "FooBARBaz.json",
7+
} as const;

0 commit comments

Comments
 (0)