Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-4237

Introduce `jsonify` to stout.

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.24.2, 0.25.1, 0.26.1, 0.27.0
    • None
    • Mesosphere Sprint 25, Mesosphere Sprint 26

    Description

      This ticket is to track the jsonify function being added to stout.

      A quick example:

      namespace store {
      
      struct Customer
      {
        std::string first_name;
        std::string last_name;
        int age;
      };
      
      void json(JSON::ObjectWriter* writer, const Customer& customer)
      {
        writer->field("first name", customer.first_name);
        writer->field("last name", customer.last_name);
        writer->field("age", customer.age);
      }
      
      } // namespace store {
      
      store::Customer customer{"michael", "park", 25};
      std::cout << jsonify(customer) << std::endl;
      // prints: {"first name":"michael","last name":"park","age":25}
      

      Refer to the design doc at MESOS-4236

      Attachments

        Activity

          People

            mcypark Michael Park
            mcypark Michael Park
            Benjamin Hindman Benjamin Hindman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: