File tree Expand file tree Collapse file tree 5 files changed +24
-32
lines changed Expand file tree Collapse file tree 5 files changed +24
-32
lines changed Original file line number Diff line number Diff line change @@ -262,8 +262,8 @@ docker run --rm -v $(pwd):$(pwd):rw -w $(pwd) -v /var/run/docker.sock:/var/run/d
262
262
* ** description** -> Description of Appwrite SDK
263
263
* ** namespace** -> SDK Namespace
264
264
* ** version** -> SDK Version
265
- * ** endpoint** -> Default Endpoint (example: "https://appwrite.io/v1 ")
266
- * ** host** -> Default Host (example: "appwrite.io")
265
+ * ** endpoint** -> Default Endpoint (example: "https://cloud. appwrite.io/v1 ")
266
+ * ** host** -> Default Host (example: "cloud. appwrite.io")
267
267
* ** basePath** -> Default Path to API (example: "/v1")
268
268
* ** licenseName** -> Name of license for SDK
269
269
* ** licenseURL** -> URL to SDK license
Original file line number Diff line number Diff line change @@ -429,23 +429,23 @@ open class Client {
429
429
if param is String
430
430
|| param is Int
431
431
|| param is Float
432
+ || param is Double
432
433
|| param is Bool
433
434
|| param is [String ]
434
435
|| param is [Int ]
435
436
|| param is [Float ]
437
+ || param is [Double ]
436
438
|| param is [Bool ]
437
439
|| param is [String: Any ]
438
440
|| param is [Int: Any ]
439
441
|| param is [Float: Any ]
442
+ || param is [Double: Any ]
440
443
|| param is [Bool: Any ] {
441
444
encodedParams [key ] = param
442
- } else {
443
- let value = try ! (param as ! Encodable ).toJson ()
444
-
445
- let range = value .index (value .startIndex , offsetBy: 1)..<value .index (value .endIndex , offsetBy: -1)
446
- let substring = value [range ]
447
-
448
- encodedParams [key ] = substring
445
+ } else if let encodable = param as ? Encodable {
446
+ encodedParams [key ] = try encodable .toJson ()
447
+ } else if let param = param {
448
+ encodedParams [key ] = String (describing: param )
449
449
}
450
450
}
451
451
Original file line number Diff line number Diff line change @@ -465,23 +465,23 @@ open class Client {
465
465
if param is String
466
466
|| param is Int
467
467
|| param is Float
468
+ || param is Double
468
469
|| param is Bool
469
470
|| param is [String ]
470
471
|| param is [Int ]
471
472
|| param is [Float ]
473
+ || param is [Double ]
472
474
|| param is [Bool ]
473
475
|| param is [String: Any ]
474
476
|| param is [Int: Any ]
475
477
|| param is [Float: Any ]
478
+ || param is [Double: Any ]
476
479
|| param is [Bool: Any ] {
477
480
encodedParams [key ] = param
478
- } else {
479
- let value = try ! (param as ! Encodable ).toJson ()
480
-
481
- let range = value .index (value .startIndex , offsetBy: 1)..<value .index (value .endIndex , offsetBy: -1)
482
- let substring = value [range ]
483
-
484
- encodedParams [key ] = substring
481
+ } else if let encodable = param as ? Encodable {
482
+ encodedParams [key ] = try encodable .toJson ()
483
+ } else if let param = param {
484
+ encodedParams [key ] = String (describing: param )
485
485
}
486
486
}
487
487
Original file line number Diff line number Diff line change 1
1
import Foundation
2
2
3
- public enum {{ enum .name | caseUcfirst | overrideIdentifier }}: String, Codable {
3
+ public enum {{ enum .name | caseUcfirst | overrideIdentifier }}: String, CustomStringConvertible {
4
4
{%~ for value in enum .enum %}
5
5
{%~ set key = enum .keys is empty ? value : enum .keys [loop .index0 ] %}
6
6
case {{ key | caseEnumKey | escapeSwiftKeyword }} = "{{ value }}"
7
7
{%~ endfor %}
8
8
9
- public func encode(to encoder: Encoder) throws {
10
- var container = encoder.singleValueContainer()
11
- try container.encode(rawValue)
9
+ public var description: String {
10
+ return rawValue
12
11
}
13
12
}
Original file line number Diff line number Diff line change @@ -139,18 +139,11 @@ public function setUp(): void
139
139
140
140
$ this ->expectedOutput [] = $ headers ;
141
141
142
- // Figure out if mock-server is running
143
- $ isMockAPIRunning = \strlen (\exec ('docker ps | grep mock-server ' )) > 0 ;
144
-
145
- if (!$ isMockAPIRunning ) {
146
- echo "Starting Mock API Server " ;
147
-
148
- \exec ('
149
- cd ./mock-server && \
150
- docker compose build && \
151
- docker compose up -d --force-recreate
152
- ' );
153
- }
142
+ \exec ('
143
+ cd ./mock-server && \
144
+ docker compose build && \
145
+ docker compose up -d --force-recreate
146
+ ' );
154
147
}
155
148
156
149
public function tearDown (): void
You can’t perform that action at this time.
0 commit comments