Comments (11)
array_of_hash.to_msgpack
?
or by hands
[1, {1 => 2}]
packer.write_array_start(2)
packer.write(1)
packer.write_hash_start(1)
packer.write(1)
packer.write(2)
from msgpack-crystal.
I think the JSON::Any is throwing the error
from msgpack-crystal.
And the slice
from msgpack-crystal.
@kostya seems not to work since I have to overloead matches
@benoist new to crystal
and compiled language, could you explain plz
from msgpack-crystal.
Welcome to crystal :-). The array of hashes has got values of type JSON::Any and Slice(UInt8) which msgpack does not know how to convert.
You can see the type of array_of_hashes by calling .class on it. It should fit the MessagePack::Type.
from msgpack-crystal.
@benoist type is Array(Hash(String, Nil | String | Float32 | Float64 | Time | JSON::Any | Bool | Int32 | Int64 | Int16 | Slice(UInt8)))
array_of_hashes contain array of hash (String,String)
but type overload seem not te be available
from msgpack-crystal.
Yes that's what I thought. There are two types that can't be MessagePacked. So either remove them from the hash or convert them to a supported type in the MessagePack::Type alias
from msgpack-crystal.
@benoist and what message pack could convert ?
String an Int ?
from msgpack-crystal.
MessagePack::Type = Nil | Bool | Int8 | Int16 | Int32 | Int64 | UInt8 | UInt16 | UInt32 | UInt64 | Float32 | Float64 | String | Array(Type) | Hash(Type, Type)
from msgpack-crystal.
Did you manage to do what you wanted?
from msgpack-crystal.
no, I have temporarily left msgpack (I' use json as my app is unstable)
from msgpack-crystal.
Related Issues (20)
- Failed giving version HOT 1
- not compiled with crystal 0.17
- Parsing an unknown data structure. HOT 1
- not correct handle union type in mapping
- Support for nested Hash HOT 2
- Crash in mapping HOT 3
- Error while building with Crystal 0.21 HOT 1
- Add support for type extension HOT 4
- Support tarantool serializable HOT 3
- Support for missing or optional HOT 1
- Bad process on nil HOT 2
- The fix of #49 doesn't cover type restriction. HOT 1
- Broken stream reading, when type mismatch
- Typo
- Can't infer the type of instance variable '@var_present' HOT 5
- Shall not include Time conversion by default HOT 11
- Missing Timestamp extension type HOT 2
- have Serializable override inspect? HOT 2
- Type discriminator HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msgpack-crystal.