Skip to content

Commit 4301303

Browse files
committed
Fix spec for demo
1 parent 86c236f commit 4301303

File tree

3 files changed

+52
-56
lines changed

3 files changed

+52
-56
lines changed

src/DefinitionGenerator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export class DefinitionGenerator {
150150
if (type === 'path') {
151151
parameterConfig.required = true;
152152
} else if (type === 'query') {
153-
parameterConfig.allowEmptyValues = parameter.allowEmptyValue || false; // OpenAPI default is false
153+
parameterConfig.allowEmptyValue = parameter.allowEmptyValue || false; // OpenAPI default is false
154154

155155
if ('allowReserved' in parameter) {
156156
parameterConfig.allowReserved = parameter.allowReserved || false;

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export interface IParameterConfig {
3636
required?: boolean;
3737
schema?: object;
3838
deprecated?: boolean;
39-
allowEmptyValues?: boolean;
39+
allowEmptyValue?: boolean;
4040
style?: 'form' | 'simple';
4141
explode?: boolean;
4242
allowReserved?: boolean;

test/project/openapi.yml

Lines changed: 50 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,4 @@
11
openapi: 3.0.0-RC1
2-
description: ''
3-
version: 0.0.0
4-
title: ''
5-
paths:
6-
/create:
7-
post:
8-
operationId: createUser
9-
summary: Create User
10-
description: Creates a user and then sends a generated password email
11-
responses:
12-
'201':
13-
description: A user object along with generated API Keys
14-
content:
15-
application/json:
16-
schema:
17-
$ref: '#/components/schemas/PutDocumentResponse'
18-
'500':
19-
description: An error message when creating a new user
20-
content:
21-
application/json:
22-
schema:
23-
$ref: '#/components/schemas/ErrorResponse'
24-
parameters:
25-
- name: username
26-
in: path
27-
description: The username for a user to create
28-
required: true
29-
schema:
30-
type: string
31-
pattern: '^[-a-z0-9_]+$'
32-
- name: membershipType
33-
in: query
34-
description: The user's Membership Type
35-
required: false
36-
allowEmptyValues: false
37-
schema:
38-
type: string
39-
enum:
40-
- premium
41-
- standard
42-
- name: SessionId
43-
in: cookie
44-
description: A Session ID variable
45-
required: false
46-
schema:
47-
type: string
48-
requestBody:
49-
content:
50-
application/json:
51-
schema:
52-
$ref: '#/components/schemas/PutDocumentRequest'
53-
description: A user information object
542
components:
553
schemas:
564
ErrorResponse:
@@ -213,8 +161,56 @@ components:
213161
SomeAttribute:
214162
type: string
215163
securitySchemes: {}
216-
servers: []
217164
info:
218165
title: ''
219166
description: ''
220-
version: a9cb0cf9-ab05-4a6b-9077-5818f1d1afb5
167+
version: 6468e32d-3e32-4d98-9e62-ef0bc4e106ef
168+
paths:
169+
/create:
170+
post:
171+
operationId: createUser
172+
summary: Create User
173+
description: Creates a user and then sends a generated password email
174+
responses:
175+
'201':
176+
description: A user object along with generated API Keys
177+
content:
178+
application/json:
179+
schema:
180+
$ref: '#/components/schemas/PutDocumentResponse'
181+
'500':
182+
description: An error message when creating a new user
183+
content:
184+
application/json:
185+
schema:
186+
$ref: '#/components/schemas/ErrorResponse'
187+
parameters:
188+
- name: username
189+
in: path
190+
description: The username for a user to create
191+
required: true
192+
schema:
193+
type: string
194+
pattern: '^[-a-z0-9_]+$'
195+
- name: membershipType
196+
in: query
197+
description: The user's Membership Type
198+
required: false
199+
allowEmptyValue: false
200+
schema:
201+
type: string
202+
enum:
203+
- premium
204+
- standard
205+
- name: SessionId
206+
in: cookie
207+
description: A Session ID variable
208+
required: false
209+
schema:
210+
type: string
211+
requestBody:
212+
content:
213+
application/json:
214+
schema:
215+
$ref: '#/components/schemas/PutDocumentRequest'
216+
description: A user information object

0 commit comments

Comments
 (0)