Skip to content

Commit e016fe1

Browse files
committed
chore: address PR feedback
1 parent 0d17ea2 commit e016fe1

File tree

9 files changed

+2
-149
lines changed

9 files changed

+2
-149
lines changed

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ public TypeScriptFetchClientCodegen() {
113113
embeddedTemplateDir = templateDir = "typescript-fetch";
114114

115115
this.apiTemplateFiles.put("apis.mustache", ".ts");
116-
this.modelTemplateFiles.put("models.mustache", ".ts");
117-
118116
this.apiDocTemplateFiles.put("api_doc.mustache", ".md");
119117
this.modelDocTemplateFiles.put("model_doc.mustache", ".md");
120118

modules/openapi-generator/src/main/resources/typescript-fetch/model_doc.mustache

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Name | Type
1111
{{#vars}}`{{name}}` | {{#isPrimitiveType}}{{dataType}}{{/isPrimitiveType}}{{^isPrimitiveType}}[{{dataType}}]({{complexType}}.md){{/isPrimitiveType}}
1212
{{/vars}}
1313

14+
{{^withoutRuntimeChecks}}
1415
## Example
1516

1617
```typescript
@@ -33,6 +34,7 @@ console.log(exampleJSON)
3334
const exampleParsed = JSON.parse(exampleJSON) as {{classname}}
3435
console.log(exampleParsed)
3536
```
37+
{{/withoutRuntimeChecks}}
3638

3739
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
3840

samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/FILES

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ src/apis/StoreApi.ts
1616
src/apis/UserApi.ts
1717
src/apis/index.ts
1818
src/index.ts
19-
src/models/Category.ts
20-
src/models/ModelApiResponse.ts
21-
src/models/Order.ts
22-
src/models/Pet.ts
23-
src/models/Tag.ts
24-
src/models/User.ts
2519
src/models/index.ts
2620
src/runtime.ts
2721
tsconfig.json

samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Category.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,6 @@ Name | Type
1010
`id` | number
1111
`name` | string
1212

13-
## Example
14-
15-
```typescript
16-
import type { Category } from '@openapitools/typescript-fetch-petstore'
17-
18-
// TODO: Update the object below with actual values
19-
const example = {
20-
"id": null,
21-
"name": null,
22-
} satisfies Category
23-
24-
console.log(example)
25-
26-
// Convert the instance to a JSON string
27-
const exampleJSON: string = JSON.stringify(example)
28-
console.log(exampleJSON)
29-
30-
// Parse the JSON string back to an object
31-
const exampleParsed = JSON.parse(exampleJSON) as Category
32-
console.log(exampleParsed)
33-
```
3413

3514
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
3615

samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/ModelApiResponse.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,6 @@ Name | Type
1111
`type` | string
1212
`message` | string
1313

14-
## Example
15-
16-
```typescript
17-
import type { ModelApiResponse } from '@openapitools/typescript-fetch-petstore'
18-
19-
// TODO: Update the object below with actual values
20-
const example = {
21-
"code": null,
22-
"type": null,
23-
"message": null,
24-
} satisfies ModelApiResponse
25-
26-
console.log(example)
27-
28-
// Convert the instance to a JSON string
29-
const exampleJSON: string = JSON.stringify(example)
30-
console.log(exampleJSON)
31-
32-
// Parse the JSON string back to an object
33-
const exampleParsed = JSON.parse(exampleJSON) as ModelApiResponse
34-
console.log(exampleParsed)
35-
```
3614

3715
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
3816

samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Order.md

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,6 @@ Name | Type
1414
`status` | string
1515
`complete` | boolean
1616

17-
## Example
18-
19-
```typescript
20-
import type { Order } from '@openapitools/typescript-fetch-petstore'
21-
22-
// TODO: Update the object below with actual values
23-
const example = {
24-
"id": null,
25-
"petId": null,
26-
"quantity": null,
27-
"shipDate": null,
28-
"status": null,
29-
"complete": null,
30-
} satisfies Order
31-
32-
console.log(example)
33-
34-
// Convert the instance to a JSON string
35-
const exampleJSON: string = JSON.stringify(example)
36-
console.log(exampleJSON)
37-
38-
// Parse the JSON string back to an object
39-
const exampleParsed = JSON.parse(exampleJSON) as Order
40-
console.log(exampleParsed)
41-
```
4217

4318
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
4419

samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Pet.md

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,6 @@ Name | Type
1414
`tags` | [Array<Tag>](Tag.md)
1515
`status` | string
1616

17-
## Example
18-
19-
```typescript
20-
import type { Pet } from '@openapitools/typescript-fetch-petstore'
21-
22-
// TODO: Update the object below with actual values
23-
const example = {
24-
"id": null,
25-
"category": null,
26-
"name": doggie,
27-
"photoUrls": null,
28-
"tags": null,
29-
"status": null,
30-
} satisfies Pet
31-
32-
console.log(example)
33-
34-
// Convert the instance to a JSON string
35-
const exampleJSON: string = JSON.stringify(example)
36-
console.log(exampleJSON)
37-
38-
// Parse the JSON string back to an object
39-
const exampleParsed = JSON.parse(exampleJSON) as Pet
40-
console.log(exampleParsed)
41-
```
4217

4318
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
4419

samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Tag.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,6 @@ Name | Type
1010
`id` | number
1111
`name` | string
1212

13-
## Example
14-
15-
```typescript
16-
import type { Tag } from '@openapitools/typescript-fetch-petstore'
17-
18-
// TODO: Update the object below with actual values
19-
const example = {
20-
"id": null,
21-
"name": null,
22-
} satisfies Tag
23-
24-
console.log(example)
25-
26-
// Convert the instance to a JSON string
27-
const exampleJSON: string = JSON.stringify(example)
28-
console.log(exampleJSON)
29-
30-
// Parse the JSON string back to an object
31-
const exampleParsed = JSON.parse(exampleJSON) as Tag
32-
console.log(exampleParsed)
33-
```
3413

3514
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
3615

samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/User.md

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,6 @@ Name | Type
1616
`phone` | string
1717
`userStatus` | number
1818

19-
## Example
20-
21-
```typescript
22-
import type { User } from '@openapitools/typescript-fetch-petstore'
23-
24-
// TODO: Update the object below with actual values
25-
const example = {
26-
"id": null,
27-
"username": null,
28-
"firstName": null,
29-
"lastName": null,
30-
"email": null,
31-
"password": null,
32-
"phone": null,
33-
"userStatus": null,
34-
} satisfies User
35-
36-
console.log(example)
37-
38-
// Convert the instance to a JSON string
39-
const exampleJSON: string = JSON.stringify(example)
40-
console.log(exampleJSON)
41-
42-
// Parse the JSON string back to an object
43-
const exampleParsed = JSON.parse(exampleJSON) as User
44-
console.log(exampleParsed)
45-
```
4619

4720
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
4821

0 commit comments

Comments
 (0)