Skip to content

Commit 42e3364

Browse files
committed
[typescript-fetch] add sample for nullable enums
1 parent 65764c3 commit 42e3364

File tree

15 files changed

+1172
-0
lines changed

15 files changed

+1172
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
generatorName: typescript-fetch
2+
outputDir: samples/client/petstore/typescript-fetch/builds/enum
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript-fetch/enum.yaml
Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
openapi: 3.0.0
2+
info:
3+
version: 1.0.0
4+
title: Enum test
5+
servers:
6+
- url: http://localhost:3000
7+
paths:
8+
/fake/enum-request-ref:
9+
get:
10+
operationId: fake-enum-request-get-ref
11+
parameters:
12+
- name: string-enum
13+
in: query
14+
schema:
15+
$ref: "#/components/schemas/StringEnum"
16+
- name: nullable-string-enum
17+
in: query
18+
schema:
19+
nullable: true
20+
allOf:
21+
- $ref: "#/components/schemas/StringEnum"
22+
- name: number-enum
23+
in: query
24+
schema:
25+
$ref: "#/components/schemas/NumberEnum"
26+
- name: nullable-number-enum
27+
in: query
28+
schema:
29+
nullable: true
30+
allOf:
31+
- $ref: "#/components/schemas/NumberEnum"
32+
responses:
33+
200:
34+
description: OK
35+
content:
36+
application/json:
37+
schema:
38+
$ref: '#/components/schemas/EnumPatternObject'
39+
post:
40+
operationId: fake-enum-request-post-ref
41+
responses:
42+
200:
43+
description: OK
44+
content:
45+
application/json:
46+
schema:
47+
$ref: '#/components/schemas/EnumPatternObject'
48+
requestBody:
49+
content:
50+
application/json:
51+
schema:
52+
$ref: "#/components/schemas/EnumPatternObject"
53+
/fake/enum-request-inline:
54+
get:
55+
operationId: fake-enum-request-get-inline
56+
parameters:
57+
- name: string-enum
58+
in: query
59+
schema:
60+
type: string
61+
enum:
62+
- one
63+
- two
64+
- three
65+
- name: nullable-string-enum
66+
in: query
67+
schema:
68+
nullable: true
69+
allOf:
70+
- type: string
71+
enum:
72+
- one
73+
- two
74+
- three
75+
- name: number-enum
76+
in: query
77+
schema:
78+
type: number
79+
enum:
80+
- 1
81+
- 2
82+
- 3
83+
- name: nullable-number-enum
84+
in: query
85+
schema:
86+
nullable: true
87+
allOf:
88+
- type: number
89+
enum:
90+
- 1
91+
- 2
92+
- 3
93+
responses:
94+
200:
95+
description: OK
96+
content:
97+
application/json:
98+
schema:
99+
type: object
100+
properties:
101+
string-enum:
102+
type: string
103+
enum:
104+
- one
105+
- two
106+
- three
107+
nullable-string-enum:
108+
nullable: true
109+
allOf:
110+
- type: string
111+
enum:
112+
- one
113+
- two
114+
- three
115+
number-enum:
116+
type: number
117+
enum:
118+
- 1
119+
- 2
120+
- 3
121+
nullable-number-enum:
122+
nullable: true
123+
allOf:
124+
- type: number
125+
enum:
126+
- 1
127+
- 2
128+
- 3
129+
post:
130+
operationId: fake-enum-request-post-inline
131+
responses:
132+
200:
133+
description: OK
134+
content:
135+
application/json:
136+
schema:
137+
type: object
138+
properties:
139+
string-enum:
140+
type: string
141+
enum:
142+
- one
143+
- two
144+
- three
145+
nullable-string-enum:
146+
nullable: true
147+
allOf:
148+
- type: string
149+
enum:
150+
- one
151+
- two
152+
- three
153+
number-enum:
154+
type: number
155+
enum:
156+
- 1
157+
- 2
158+
- 3
159+
nullable-number-enum:
160+
nullable: true
161+
allOf:
162+
- type: number
163+
enum:
164+
- 1
165+
- 2
166+
- 3
167+
requestBody:
168+
content:
169+
application/json:
170+
schema:
171+
type: object
172+
properties:
173+
string-enum:
174+
type: string
175+
enum:
176+
- one
177+
- two
178+
- three
179+
nullable-string-enum:
180+
nullable: true
181+
allOf:
182+
- type: string
183+
enum:
184+
- one
185+
- two
186+
- three
187+
number-enum:
188+
type: number
189+
enum:
190+
- 1
191+
- 2
192+
- 3
193+
nullable-number-enum:
194+
nullable: true
195+
allOf:
196+
- type: number
197+
enum:
198+
- 1
199+
- 2
200+
- 3
201+
components:
202+
schemas:
203+
StringEnum:
204+
type: string
205+
enum:
206+
- one
207+
- two
208+
- three
209+
NumberEnum:
210+
type: number
211+
enum:
212+
- 1
213+
- 2
214+
- 3
215+
EnumPatternObject:
216+
type: object
217+
properties:
218+
string-enum:
219+
$ref: "#/components/schemas/StringEnum"
220+
nullable-string-enum:
221+
nullable: true
222+
allOf:
223+
- $ref: "#/components/schemas/StringEnum"
224+
number-enum:
225+
$ref: "#/components/schemas/NumberEnum"
226+
nullable-number-enum:
227+
nullable: true
228+
allOf:
229+
- $ref: "#/components/schemas/NumberEnum"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apis/DefaultApi.ts
2+
apis/index.ts
3+
index.ts
4+
models/EnumPatternObject.ts
5+
models/InlineObject.ts
6+
models/InlineResponse200.ts
7+
models/NumberEnum.ts
8+
models/StringEnum.ts
9+
models/index.ts
10+
runtime.ts
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5.0.0-SNAPSHOT

0 commit comments

Comments
 (0)