msgpack / msgpack-cli

MessagePack implementation for Common Language Infrastructure / msgpack.org[C#]
http://msgpack.org
Apache License 2.0
834 stars 175 forks source link

Serialize items differently #292

Closed NextSim closed 6 years ago

NextSim commented 6 years ago

I need to serialize a class where some of the class is serialized with the context set to map, but some is set to the default.

How would I create a class structure that would be able to serialize the data so it would be formatted like the data below (in JSON)

[ 0, 3, "setCarControls", [ { "throttle": 0.5, "steering": 0, "brake": 0, "handbrake": true, "is_manual_gear": false, "manual_gear": 0, "gear_immediate": true } ] ]

yfakariya commented 6 years ago

Sorry for delay. Would you tell me sample code snippet to repro this?