Skip to content

Commit be3b608

Browse files
committed
chore: add schema for nullable fields\objects
1 parent 6147647 commit be3b608

File tree

7 files changed

+181
-288
lines changed

7 files changed

+181
-288
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
"test:partialBaseTemplate": "node tests/spec/partialBaseTemplate/test.js",
5353
"test:partialDefaultTemplate": "node tests/spec/partialDefaultTemplate/test.js",
5454
"test:--patch": "node tests/spec/patch/test.js",
55-
"test:deprecated": "node tests/spec/deprecated/test.js"
55+
"test:deprecated": "node tests/spec/deprecated/test.js",
56+
"test:nullableRefTest": "node tests/spec/nullable/test.js"
5657
},
5758
"author": "acacode",
5859
"license": "MIT",

tests/generated/v3.0/nullable-refs.ts

Lines changed: 0 additions & 238 deletions
This file was deleted.

tests/schemas/v3.0/nullable-refs.yaml

Lines changed: 0 additions & 49 deletions
This file was deleted.

tests/spec/nullable/expected.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/* eslint-disable */
2+
/* tslint:disable */
3+
/*
4+
* ---------------------------------------------------------------
5+
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
6+
* ## ##
7+
* ## AUTHOR: acacode ##
8+
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
9+
* ---------------------------------------------------------------
10+
*/
11+
12+
export type MyObject = {
13+
id: string;
14+
name: string;
15+
} | null;
16+
17+
export interface TestObject {
18+
stringMaybeUndefined?: string;
19+
stringMaybeNullA: string | null;
20+
stringMaybeNullB: null;
21+
stringMaybeNullAndUndefined?: null;
22+
otherObjectMaybeUndefined?: OtherObject;
23+
otherObjectMaybeNullA: OtherObject | null;
24+
otherObjectMaybeNullB: OtherObject | null;
25+
otherObjectMaybeNullC: OtherObject | null;
26+
otherObjectMaybeNullD: OtherObject | null | (OtherObject & null);
27+
}
28+
29+
export type OtherObject = object;

0 commit comments

Comments
 (0)