Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions example/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,13 @@ components:
type: string
message:
type: string
FooBARBaz:
$ref: '#/components/schemas/FooBARBaz'
xml:
name: '##default'
FooBARBaz:
type: string
description: this name is valid and should be FooBARBaz everywhere it appears
requestBodies:
Pet:
description: Pet object that needs to be added to the store
Expand Down
3 changes: 3 additions & 0 deletions example/output/json/components.schemas/ApiResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
},
"message": {
"type": "string"
},
"FooBARBaz": {
"$ref": "FooBARBaz.json"
}
},
"title": "ApiResponse",
Expand Down
6 changes: 6 additions & 0 deletions example/output/json/components.schemas/FooBARBaz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "string",
"description": "this name is valid and should be FooBARBaz everywhere it appears",
"title": "FooBARBaz",
"$id": "FooBARBaz.json"
}
7 changes: 7 additions & 0 deletions example/output/ts/ApiResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ export const ApiResponse = {
},
type: { type: "string" },
message: { type: "string" },
FooBARBaz: {
type: "string",
description:
"this name is valid and should be FooBARBaz everywhere it appears",
title: "FooBARBaz",
$id: "FooBARBaz.json",
},
},
title: "ApiResponse",
$id: "ApiResponse.json",
Expand Down
7 changes: 7 additions & 0 deletions example/output/ts/FooBARBaz.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const FooBARBaz = {
type: "string",
description:
"this name is valid and should be FooBARBaz everywhere it appears",
title: "FooBARBaz",
$id: "FooBARBaz.json",
} as const;
11 changes: 11 additions & 0 deletions example/output/tson/Address.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export const Address = {
type: "object",
properties: {
street: { type: "string" },
city: { type: "string" },
state: { type: "string" },
zip: { type: "string" },
},
title: "Address",
$id: "Address.json",
} as const;
22 changes: 22 additions & 0 deletions example/output/tson/ApiResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export const ApiResponse = {
type: "object",
properties: {
code: {
type: "integer",
format: "int32",
minimum: -2147483648,
maximum: 2147483647,
},
type: { type: "string" },
message: { type: "string" },
FooBARBaz: {
type: "string",
description:
"this name is valid and should be FooBARBaz everywhere it appears",
title: "FooBARBaz",
$id: "FooBARBaz.json",
},
},
title: "ApiResponse",
$id: "ApiResponse.json",
} as const;
14 changes: 14 additions & 0 deletions example/output/tson/Category.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export const Category = {
type: "object",
properties: {
id: {
type: "integer",
format: "int64",
minimum: -9223372036854776000,
maximum: 9223372036854776000,
},
name: { type: "string" },
},
title: "Category",
$id: "Category.json",
} as const;
28 changes: 28 additions & 0 deletions example/output/tson/Customer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export const Customer = {
type: "object",
properties: {
id: {
type: "integer",
format: "int64",
minimum: -9223372036854776000,
maximum: 9223372036854776000,
},
username: { type: "string" },
address: {
type: "array",
items: {
type: "object",
properties: {
street: { type: "string" },
city: { type: "string" },
state: { type: "string" },
zip: { type: "string" },
},
title: "Address",
$id: "Address.json",
},
},
},
title: "Customer",
$id: "Customer.json",
} as const;
7 changes: 7 additions & 0 deletions example/output/tson/FooBARBaz.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const FooBARBaz = {
type: "string",
description:
"this name is valid and should be FooBARBaz everywhere it appears",
title: "FooBARBaz",
$id: "FooBARBaz.json",
} as const;
32 changes: 32 additions & 0 deletions example/output/tson/Order.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
export const Order = {
type: "object",
properties: {
id: {
type: "integer",
format: "int64",
minimum: -9223372036854776000,
maximum: 9223372036854776000,
},
petId: {
type: "integer",
format: "int64",
minimum: -9223372036854776000,
maximum: 9223372036854776000,
},
quantity: {
type: "integer",
format: "int32",
minimum: -2147483648,
maximum: 2147483647,
},
shipDate: { type: "string", format: "date-time" },
status: {
type: "string",
description: "Order Status",
enum: ["placed", "approved", "delivered"],
},
complete: { type: "boolean" },
},
title: "Order",
$id: "Order.json",
} as const;
56 changes: 56 additions & 0 deletions example/output/tson/Pet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
export const Pet = {
required: ["name", "photoUrls"],
type: "object",
properties: {
id: {
type: "integer",
format: "int64",
minimum: -9223372036854776000,
maximum: 9223372036854776000,
},
name: { type: "string" },
category: {
type: "object",
properties: {
id: {
type: "integer",
format: "int64",
minimum: -9223372036854776000,
maximum: 9223372036854776000,
},
name: { type: "string" },
},
title: "Category",
$id: "Category.json",
},
photoUrls: { type: "array", items: { type: "string" } },
tags: {
type: "array",
items: {
type: "object",
properties: {
id: {
type: "integer",
format: "int64",
minimum: -9223372036854776000,
maximum: 9223372036854776000,
},
name: { type: "string" },
},
title: "Tag",
$id: "Tag.json",
},
},
status: {
type: "string",
description: "pet status in the store",
enum: ["available", "pending", "sold"],
},
nullableValue: {
type: ["string", "null"],
description: "example nullable value",
},
},
title: "Pet",
$id: "Pet.json",
} as const;
14 changes: 14 additions & 0 deletions example/output/tson/Tag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export const Tag = {
type: "object",
properties: {
id: {
type: "integer",
format: "int64",
minimum: -9223372036854776000,
maximum: 9223372036854776000,
},
name: { type: "string" },
},
title: "Tag",
$id: "Tag.json",
} as const;
26 changes: 26 additions & 0 deletions example/output/tson/User.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export const User = {
type: "object",
properties: {
id: {
type: "integer",
format: "int64",
minimum: -9223372036854776000,
maximum: 9223372036854776000,
},
username: { type: "string" },
firstName: { type: "string" },
lastName: { type: "string" },
email: { type: "string" },
password: { type: "string" },
phone: { type: "string" },
userStatus: {
type: "integer",
description: "User Status",
format: "int32",
minimum: -2147483648,
maximum: 2147483647,
},
},
title: "User",
$id: "User.json",
} as const;
3 changes: 3 additions & 0 deletions example/output/types/ApiResponse.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { FooBARBaz } from './FooBARBaz';

/* eslint-disable */
/**
* This file was automatically generated by openapi-transformer-toolkit CLI/methods.
Expand All @@ -9,5 +11,6 @@ export interface ApiResponse {
code?: number;
type?: string;
message?: string;
FooBARBaz?: FooBARBaz;
[k: string]: unknown;
}
11 changes: 11 additions & 0 deletions example/output/types/FooBARBaz.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-disable */
/**
* This file was automatically generated by openapi-transformer-toolkit CLI/methods.
* DO NOT MODIFY IT BY HAND. Instead, modify the source OpenAPI file,
* and run openapi-transformer-toolkit CLI/methods to regenerate this file.
*/

/**
* this name is valid and should be FooBARBaz everywhere it appears
*/
export type FooBARBaz = string;
Loading
Loading