Skip to content

Commit 5f8f8cc

Browse files
committed
fixed default value for booleans
1 parent 386e803 commit 5f8f8cc

File tree

4 files changed

+8
-29
lines changed

4 files changed

+8
-29
lines changed

lib/swagger-operation-spec.js

Lines changed: 5 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/swagger.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/swagger-operation-spec.coffee

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ describe 'SwaggerRequest', ->
9595
expect(param.type).toBe "Pet"
9696
expect(param.paramType).toBe "body"
9797
expect(param.description).toBeDefined
98-
expect(param.required).toBe true
99-
10098

10199
it "verifies the put pet operation", ->
102100
operation = swagger.pet.operations.updatePet
@@ -112,8 +110,6 @@ describe 'SwaggerRequest', ->
112110
expect(param.type).toBe "Pet"
113111
expect(param.paramType).toBe "body"
114112
expect(param.description).toBeDefined
115-
expect(param.required).toBe true
116-
117113
it "verifies the findByTags operation", ->
118114
operation = swagger.pet.operations.findPetsByTags
119115
expect(operation.method).toBe "get"
@@ -124,12 +120,11 @@ describe 'SwaggerRequest', ->
124120
expect(parameters.length).toBe 1
125121

126122
param = parameters[0]
123+
console.log param
127124
expect(param.name).toBe "tags"
128125
expect(param.type).toBe "string"
129126
expect(param.paramType).toBe "query"
130127
expect(param.description).toBeDefined
131-
expect(param.required).toBe true
132-
expect(param.allowMultiple).toBe true
133128

134129
it "verifies the patch pet operation", ->
135130
operation = swagger.pet.operations.partialUpdate
@@ -155,9 +150,6 @@ describe 'SwaggerRequest', ->
155150
expect(param.type).toBe "Pet"
156151
expect(param.paramType).toBe "body"
157152
expect(param.description).toBeDefined
158-
expect(param.allowMultiple).toBe false
159-
expect(param.required).toBe true
160-
161153

162154
it "verifies the post pet operation with form", ->
163155
operation = swagger.pet.operations.updatePetWithForm
@@ -175,23 +167,20 @@ describe 'SwaggerRequest', ->
175167
expect(param.name).toBe "petId"
176168
expect(param.type).toBe "string"
177169
expect(param.paramType).toBe "path"
178-
expect(param.required).toBe true
179170
expect(param.description).toBeDefined
180171

181172
param = parameters[1]
182173
expect(param.name).toBe "name"
183174
expect(param.type).toBe "string"
184175
expect(param.paramType).toBe "form"
185176
expect(param.description).toBeDefined
186-
expect(param.allowMultiple).toBe false
187177
expect(param.required).toBe false
188178

189179
param = parameters[2]
190180
expect(param.name).toBe "status"
191181
expect(param.type).toBe "string"
192182
expect(param.paramType).toBe "form"
193183
expect(param.description).toBeDefined
194-
expect(param.allowMultiple).toBe false
195184
expect(param.required).toBe false
196185

197186
it "verifies a file upload", ->
@@ -218,7 +207,6 @@ describe 'SwaggerRequest', ->
218207
expect(param.type).toBe "File"
219208
expect(param.paramType).toBe "body"
220209
expect(param.description).toBeDefined
221-
expect(param.allowMultiple).toBe false
222210
expect(param.required).toBe false
223211

224212
it "gets help() from the file upload operation", ->

src/swagger.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ class SwaggerOperation
437437

438438
if(type.toLowerCase() is 'boolean')
439439
parameter.allowableValues = {}
440-
parameter.allowableValues.values = @resource.api.booleanValues
440+
parameter.allowableValues.values = ["true", "false"]
441441

442442
parameter.signature = @getSignature(type, @resource.models)
443443
parameter.sampleJSON = @getSampleJSON(type, @resource.models)

0 commit comments

Comments
 (0)