Coder Social home page Coder Social logo

Comments (3)

andrewserff avatar andrewserff commented on September 18, 2024

Sorry for the delay, I wanted to find out if you are still having this problem. Let me know.

from json-data-generator.

icesuperbravo avatar icesuperbravo commented on September 18, 2024

Hi, I think I also met the similar problem as the question provider in this post. But right now I just resolved it by modifying the source code which I think might not be an elegant solution.
So the case is, I am using JSON-data-generator to an endpoint provided by POWER BI for data visualization through HTTPS request. But my POWER BI service just couldn't receive any data thro REST API. Thus, I just took a lot of time debugging it and finally found that the problem came from the json format.
For POWER BI(I am not sure about other services), the example data in the documentation
{"timestamp":1430244584899,"system":"BADGE","actor":"bob","action":"LOGOUT","objects":["Building 1"],"location":{"lat":-19.4224,"lon":-165.0512},"message":"Entered Building 1"}
should be restricted as:

[{"timestamp":1430244584899,"system":"BADGE","actor":"bob","action":"LOGOUT","objects": "Building 1","location":"lat:-19.4224, lon:-165.0512","message":"Entered Building 1"}] 
//pay attention to that array and objects are not allowed in the content field;

The solution is I manually added a pair of "[]" to wrap the original json as an array with one item in EventLogger.java. In this case, it's better to add a configuration interface in WorkFlow.json to allow users to reprensent json as object or array. (just my objective opinion on this tool).
Hope it will help the people with the same problem. Cheers!

from json-data-generator.

andrewserff avatar andrewserff commented on September 18, 2024

So based on @icesuperbravo's feedback, it seems like this is a data format problem and could probably be handled as a specific Logger configuration option. If the receiving endpoint needs the data as an array, then the Logger should handle that. The HttpLogger that you guys are using is a generic logger that assumes that it can just post each event as a json object. Other loggers do things like flatten the json before sending it. So if the POWER BI or other service expects the format to be different, then a customer Logger may be in order.

from json-data-generator.

Related Issues (20)

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.