Giter VIP home page Giter VIP logo

bsonpp's People

Contributors

timstableford avatar

Stargazers

 avatar  avatar

Forkers

schnilz

bsonpp's Issues

Cannot parse a document with keys after a sub-document

Hi there,

I'm working on an embedded project to translate MIDI signals for vintage synthesizers. I need to send complex messages to the device to load/save settings. I initially rolled my own communication protocol for these messages, but that strategy won't scale, so I want to move to a standard data format like BSON, so I can spend less time on writing (de)serialization code.

I gave the bsonpp library a try, but I'm running into an issue. Here is an example message I want to send, in JSON format:

{
  "cmd": 1,
  "ctrl": {
    "rows": 2,
    "cols": 4,
    "ccs": [1, 2, 3, 4, 5, 6, 7, 8]
  },
  "outs": [
    {
      "pid": 1,
      "sid": 1,
      "mfg": "Roland",
      "syn": "Juno 60",
      "chn": 1,
      "ccs": [11, 12, 13, 14, 15, 16, 17, 18]
    }
  ]
}

I was able to parse the cmd and ctrl fields, but calling document.getKeyCount() returns BSONPP_INCORRECT_TYPE. Attempting to parse the outs field also fails.

I simplified the message down to narrow down the issue. It looks like having any keys after a sub-document will cause these issues.

For example, bsonpp fails to parse the last field value on this simpler document:

{
  "cmd": 1,
  "ctrl": {
    "rows": 2,
    "cols": 4
  },
  "last": 42
}

Hopefully this is enough info to repro the issue. Thanks for your work on this library!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.