Advertisement
Guest User

crystal JSON error

a guest
Nov 4th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.85 KB | None | 0 0
  1. Error in line 5: while requiring "./spec/docker/client/images_spec.cr"
  2.  
  3. in spec/docker/client/images_spec.cr:60: instantiating 'Docker::ImageCollection.class#[](String)'
  4.  
  5. gotten = Docker::ImageCollection["sha256 hash value"]
  6. ^
  7.  
  8. in src/docker/client/images.cr:83: instantiating 'Docker::ImageCollection.class#request()'
  9.  
  10. self.request.each { |img| return img if img.id === img_id }
  11. ^~~~~~~
  12.  
  13. in src/docker/client/images.cr:54: instantiating 'from_json(String)'
  14.  
  15. from_json response.body
  16. ^~~~~~~~~
  17.  
  18. in /usr/share/crystal/src/json/from_json.cr:13: instantiating 'new(JSON::PullParser)'
  19.  
  20. new parser
  21. ^~~
  22.  
  23. in /usr/share/crystal/src/json/from_json.cr:103: instantiating 'new(JSON::PullParser)'
  24.  
  25. new(pull) do |element|
  26. ^~~
  27.  
  28. in /usr/share/crystal/src/json/from_json.cr:110: instantiating 'JSON::PullParser#read_array()'
  29.  
  30. pull.read_array do
  31. ^~~~~~~~~~
  32.  
  33. in /usr/share/crystal/src/json/from_json.cr:110: instantiating 'JSON::PullParser#read_array()'
  34.  
  35. pull.read_array do
  36. ^~~~~~~~~~
  37.  
  38. in /usr/share/crystal/src/json/from_json.cr:111: instantiating 'Docker::Image.class#new(JSON::PullParser)'
  39.  
  40. yield T.new(pull)
  41. ^~~
  42.  
  43. in /usr/share/crystal/src/json/serialization.cr:136: expanding macro
  44.  
  45. {% begin %}
  46. ^
  47.  
  48. in macro 'macro_140536185445776' /usr/share/crystal/src/json/serialization.cr:136, line 259:
  49.  
  50. 1.
  51. 2.
  52. 3.
  53. 4.
  54. 5.
  55. 6.
  56. 7.
  57. 8.
  58. 9.
  59. 10.
  60. 11.
  61. 12.
  62. 13.
  63. 14.
  64. 15.
  65. 16.
  66. 17.
  67. 18.
  68. 19.
  69. 20.
  70. 21.
  71. 22.
  72. 23.
  73. 24.
  74. 25.
  75. 26.
  76. 27.
  77. 28.
  78. 29.
  79. 30.
  80. 31.
  81. 32.
  82. 33.
  83. 34.
  84. 35.
  85. 36.
  86. 37.
  87. 38.
  88. 39.
  89. 40.
  90. 41.
  91. 42.
  92. 43.
  93. 44.
  94. 45.
  95. 46.
  96. 47.
  97. 48.
  98. 49.
  99. 50.
  100. 51.
  101. 52.
  102. 53.
  103. 54.
  104. 55.
  105. 56. __temp_1387 = nil
  106. 57. __temp_1388 = false
  107. 58.
  108. 59. __temp_1389 = nil
  109. 60. __temp_1390 = false
  110. 61.
  111. 62. __temp_1391 = nil
  112. 63. __temp_1392 = false
  113. 64.
  114. 65. __temp_1393 = nil
  115. 66. __temp_1394 = false
  116. 67.
  117. 68. __temp_1395 = nil
  118. 69. __temp_1396 = false
  119. 70.
  120. 71. __temp_1397 = nil
  121. 72. __temp_1398 = false
  122. 73.
  123. 74. __temp_1399 = nil
  124. 75. __temp_1400 = false
  125. 76.
  126. 77. __temp_1401 = nil
  127. 78. __temp_1402 = false
  128. 79.
  129. 80. __temp_1403 = nil
  130. 81. __temp_1404 = false
  131. 82.
  132. 83. __temp_1405 = nil
  133. 84. __temp_1406 = false
  134. 85.
  135. 86.
  136. 87. __temp_1407 = pull.location
  137. 88. begin
  138. 89. pull.read_begin_object
  139. 90. rescue exc : ::JSON::ParseException
  140. 91. raise ::JSON::MappingError.new(exc.message, self.class.to_s, nil, *__temp_1407, exc)
  141. 92. end
  142. 93. while pull.kind != :end_object
  143. 94. __temp_1408 = pull.location
  144. 95. key = pull.read_object_key
  145. 96. case key
  146. 97.
  147. 98. when "Id"
  148. 99. __temp_1388 = true
  149. 100. begin
  150. 101. __temp_1387 =
  151. 102.
  152. 103.
  153. 104.
  154. 105.
  155. 106.
  156. 107. ::Union(String).new(pull)
  157. 108.
  158. 109.
  159. 110.
  160. 111.
  161. 112.
  162. 113. rescue exc : ::JSON::ParseException
  163. 114. raise ::JSON::MappingError.new(exc.message, self.class.to_s, "Id", *__temp_1408, exc)
  164. 115. end
  165. 116.
  166. 117. when "ParentId"
  167. 118. __temp_1390 = true
  168. 119. begin
  169. 120. __temp_1389 =
  170. 121.
  171. 122.
  172. 123.
  173. 124.
  174. 125.
  175. 126. ::Union(String).new(pull)
  176. 127.
  177. 128.
  178. 129.
  179. 130.
  180. 131.
  181. 132. rescue exc : ::JSON::ParseException
  182. 133. raise ::JSON::MappingError.new(exc.message, self.class.to_s, "ParentId", *__temp_1408, exc)
  183. 134. end
  184. 135.
  185. 136. when "RepoTags"
  186. 137. __temp_1392 = true
  187. 138. begin
  188. 139. __temp_1391 =
  189. 140.
  190. 141.
  191. 142.
  192. 143.
  193. 144.
  194. 145. ::Union(Array(String)).new(pull)
  195. 146.
  196. 147.
  197. 148.
  198. 149.
  199. 150.
  200. 151. rescue exc : ::JSON::ParseException
  201. 152. raise ::JSON::MappingError.new(exc.message, self.class.to_s, "RepoTags", *__temp_1408, exc)
  202. 153. end
  203. 154.
  204. 155. when "RepoDigests"
  205. 156. __temp_1394 = true
  206. 157. begin
  207. 158. __temp_1393 =
  208. 159.
  209. 160.
  210. 161.
  211. 162.
  212. 163.
  213. 164. ::Union(Array(String)).new(pull)
  214. 165.
  215. 166.
  216. 167.
  217. 168.
  218. 169.
  219. 170. rescue exc : ::JSON::ParseException
  220. 171. raise ::JSON::MappingError.new(exc.message, self.class.to_s, "RepoDigests", *__temp_1408, exc)
  221. 172. end
  222. 173.
  223. 174. when "Created"
  224. 175. __temp_1396 = true
  225. 176. begin
  226. 177. __temp_1395 =
  227. 178.
  228. 179.
  229. 180.
  230. 181.
  231. 182.
  232. 183. ::Union(Int32).new(pull)
  233. 184.
  234. 185.
  235. 186.
  236. 187.
  237. 188.
  238. 189. rescue exc : ::JSON::ParseException
  239. 190. raise ::JSON::MappingError.new(exc.message, self.class.to_s, "Created", *__temp_1408, exc)
  240. 191. end
  241. 192.
  242. 193. when "Size"
  243. 194. __temp_1398 = true
  244. 195. begin
  245. 196. __temp_1397 =
  246. 197.
  247. 198.
  248. 199.
  249. 200.
  250. 201.
  251. 202. ::Union(Int32).new(pull)
  252. 203.
  253. 204.
  254. 205.
  255. 206.
  256. 207.
  257. 208. rescue exc : ::JSON::ParseException
  258. 209. raise ::JSON::MappingError.new(exc.message, self.class.to_s, "Size", *__temp_1408, exc)
  259. 210. end
  260. 211.
  261. 212. when "SharedSize"
  262. 213. __temp_1400 = true
  263. 214. begin
  264. 215. __temp_1399 =
  265. 216.
  266. 217.
  267. 218.
  268. 219.
  269. 220.
  270. 221. ::Union(Int32).new(pull)
  271. 222.
  272. 223.
  273. 224.
  274. 225.
  275. 226.
  276. 227. rescue exc : ::JSON::ParseException
  277. 228. raise ::JSON::MappingError.new(exc.message, self.class.to_s, "SharedSize", *__temp_1408, exc)
  278. 229. end
  279. 230.
  280. 231. when "VirtualSize"
  281. 232. __temp_1402 = true
  282. 233. begin
  283. 234. __temp_1401 =
  284. 235.
  285. 236.
  286. 237.
  287. 238.
  288. 239.
  289. 240. ::Union(Int32).new(pull)
  290. 241.
  291. 242.
  292. 243.
  293. 244.
  294. 245.
  295. 246. rescue exc : ::JSON::ParseException
  296. 247. raise ::JSON::MappingError.new(exc.message, self.class.to_s, "VirtualSize", *__temp_1408, exc)
  297. 248. end
  298. 249.
  299. 250. when "Labels"
  300. 251. __temp_1404 = true
  301. 252. begin
  302. 253. __temp_1403 =
  303. 254.
  304. 255.
  305. 256.
  306. 257.
  307. 258.
  308. >259. ::Union(Hash(String, String)).new(pull)
  309. 260.
  310. 261.
  311. 262.
  312. 263.
  313. 264.
  314. 265. rescue exc : ::JSON::ParseException
  315. 266. raise ::JSON::MappingError.new(exc.message, self.class.to_s, "Labels", *__temp_1408, exc)
  316. 267. end
  317. 268.
  318. 269. when "Containers"
  319. 270. __temp_1406 = true
  320. 271. begin
  321. 272. __temp_1405 =
  322. 273.
  323. 274.
  324. 275.
  325. 276.
  326. 277.
  327. 278. ::Union(Int32).new(pull)
  328. 279.
  329. 280.
  330. 281.
  331. 282.
  332. 283.
  333. 284. rescue exc : ::JSON::ParseException
  334. 285. raise ::JSON::MappingError.new(exc.message, self.class.to_s, "Containers", *__temp_1408, exc)
  335. 286. end
  336. 287.
  337. 288. else
  338. 289. on_unknown_json_attribute(pull, key, __temp_1408)
  339. 290. end
  340. 291. end
  341. 292. pull.read_next
  342. 293.
  343. 294.
  344. 295.
  345. 296. if __temp_1387.nil? && !__temp_1388 && !::Union(String).nilable?
  346. 297. raise ::JSON::MappingError.new("Missing JSON attribute: Id", self.class.to_s, nil, *__temp_1407, nil)
  347. 298. end
  348. 299.
  349. 300.
  350. 301.
  351. 302. @id = (__temp_1387).as(String)
  352. 303.
  353. 304.
  354. 305.
  355. 306.
  356. 307.
  357. 308. if __temp_1389.nil? && !__temp_1390 && !::Union(String).nilable?
  358. 309. raise ::JSON::MappingError.new("Missing JSON attribute: ParentId", self.class.to_s, nil, *__temp_1407, nil)
  359. 310. end
  360. 311.
  361. 312.
  362. 313.
  363. 314. @parent_id = (__temp_1389).as(String)
  364. 315.
  365. 316.
  366. 317.
  367. 318.
  368. 319.
  369. 320. if __temp_1391.nil? && !__temp_1392 && !::Union(Array(String)).nilable?
  370. 321. raise ::JSON::MappingError.new("Missing JSON attribute: RepoTags", self.class.to_s, nil, *__temp_1407, nil)
  371. 322. end
  372. 323.
  373. 324.
  374. 325.
  375. 326. @repo_tags = (__temp_1391).as(Array(String))
  376. 327.
  377. 328.
  378. 329.
  379. 330.
  380. 331.
  381. 332. if __temp_1393.nil? && !__temp_1394 && !::Union(Array(String)).nilable?
  382. 333. raise ::JSON::MappingError.new("Missing JSON attribute: RepoDigests", self.class.to_s, nil, *__temp_1407, nil)
  383. 334. end
  384. 335.
  385. 336.
  386. 337.
  387. 338. @repo_digests = (__temp_1393).as(Array(String))
  388. 339.
  389. 340.
  390. 341.
  391. 342.
  392. 343.
  393. 344. if __temp_1395.nil? && !__temp_1396 && !::Union(Int32).nilable?
  394. 345. raise ::JSON::MappingError.new("Missing JSON attribute: Created", self.class.to_s, nil, *__temp_1407, nil)
  395. 346. end
  396. 347.
  397. 348.
  398. 349.
  399. 350. @created_at = (__temp_1395).as(Int32)
  400. 351.
  401. 352.
  402. 353.
  403. 354.
  404. 355.
  405. 356. if __temp_1397.nil? && !__temp_1398 && !::Union(Int32).nilable?
  406. 357. raise ::JSON::MappingError.new("Missing JSON attribute: Size", self.class.to_s, nil, *__temp_1407, nil)
  407. 358. end
  408. 359.
  409. 360.
  410. 361.
  411. 362. @size = (__temp_1397).as(Int32)
  412. 363.
  413. 364.
  414. 365.
  415. 366.
  416. 367.
  417. 368. if __temp_1399.nil? && !__temp_1400 && !::Union(Int32).nilable?
  418. 369. raise ::JSON::MappingError.new("Missing JSON attribute: SharedSize", self.class.to_s, nil, *__temp_1407, nil)
  419. 370. end
  420. 371.
  421. 372.
  422. 373.
  423. 374. @shared_size = (__temp_1399).as(Int32)
  424. 375.
  425. 376.
  426. 377.
  427. 378.
  428. 379.
  429. 380. if __temp_1401.nil? && !__temp_1402 && !::Union(Int32).nilable?
  430. 381. raise ::JSON::MappingError.new("Missing JSON attribute: VirtualSize", self.class.to_s, nil, *__temp_1407, nil)
  431. 382. end
  432. 383.
  433. 384.
  434. 385.
  435. 386. @virtual_size = (__temp_1401).as(Int32)
  436. 387.
  437. 388.
  438. 389.
  439. 390.
  440. 391.
  441. 392. if __temp_1403.nil? && !__temp_1404 && !::Union(Hash(String, String)).nilable?
  442. 393. raise ::JSON::MappingError.new("Missing JSON attribute: Labels", self.class.to_s, nil, *__temp_1407, nil)
  443. 394. end
  444. 395.
  445. 396.
  446. 397.
  447. 398. @labels = (__temp_1403).as(Hash(String, String))
  448. 399.
  449. 400.
  450. 401.
  451. 402.
  452. 403.
  453. 404. if __temp_1405.nil? && !__temp_1406 && !::Union(Int32).nilable?
  454. 405. raise ::JSON::MappingError.new("Missing JSON attribute: Containers", self.class.to_s, nil, *__temp_1407, nil)
  455. 406. end
  456. 407.
  457. 408.
  458. 409.
  459. 410. @containers = (__temp_1405).as(Int32)
  460. 411.
  461. 412.
  462. 413.
  463. 414.
  464. 415.
  465.  
  466. wrong number of arguments for 'Hash(String, String)#initialize' (given 1, expected 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement