Questions tagged [fastjson]

A fast JSON parser/generator for Java, or a smallest, fastest polymorphic JSON serializer for C#.

Fastjson(disambiguation)

java

Fastjson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to convert a JSON string to an equivalent Java object. Fastjson can work with arbitrary Java objects including pre-existing objects that you do not have source-code of.

C#

Fastjson is the smallest and fastest polymorphic JSON serializer.

49 questions
12
votes
3 answers

Most efficient way to fix an invalid JSON

I am stuck in an impossible situation. I have a JSON from outer space (there is no way they are going to change it). Here is the JSON { user:'180111', title:'I\'m sure "E pluribus unum" means \'Out of Many, One.\'…
AaA
  • 3,600
  • 8
  • 61
  • 86
7
votes
2 answers

How to use FastJson to go from Json string to Object Collection

I am using fastJSON and I ran into a problem. I cannot take a JSON string and convert it to a collection of objects. I thought it could handle this but maybe I am doing it wrong or misunderstood. Handles polymorphic collections of objects Here is…
chobo2
  • 83,322
  • 195
  • 530
  • 832
5
votes
2 answers

Dapper result to json (using fastjson)

===== UPDATED 8/20/2016 ===== latest version of fastjson can now handle Dictionary type correctly, my problem is solved now. ============================= I'm using fastjson to serialize the query result from Dapper, the table in DB has…
ineztia
  • 815
  • 1
  • 13
  • 29
5
votes
1 answer

fastJson Deserialize Unhandled Exception

I'm using fastJson library to deserialize a json string to a "Person" object. The Person class is defined below: class Person { public string type; public string id; public string name; } The Json string is: [{ "type":…
ChandlerQ
  • 1,428
  • 2
  • 21
  • 29
2
votes
0 answers

fastjson can't correctly transfer complex object or the cast I use is wrong?

fastjson can't correctly transfer complex object or the cast I use is wrong. I find a question in my project.so write a test like this: import com.alibaba.fastjson.JSONObject; import java.io.IOException; import java.util.ArrayList; import…
Fanl
  • 1,491
  • 2
  • 11
  • 15
2
votes
1 answer

FastJSON - How to use?

I've started using FastJSON and I'm having some problems for use it. I can't find any guide or documentation in internet, only a little extract in CodeProject. For example: I've got this class: [Serializable] public class Prueba { public…
JorgeAM
  • 91
  • 2
  • 10
2
votes
1 answer

fastJSON Deserialization List

So sort of a build on from a previous question of mine. I am trying to save a blueprint, which is just a heap of settings for a gameobject/Entity. I'm now storing the components (And their settings) as a List < IEntityComponent > (IEntityComponent…
Lolop
  • 67
  • 10
1
vote
2 answers

How to include libraries (such as fastJSON) in a c# (gmcs) project

Disclaimer: I just made by hello world with gmcs yesterday Problem I want to use fastJSON in my project using gmcs. How do I compile the project, consisting of 10 or so files into a library? statically link against that library with my 1-file…
coolaj86
  • 74,004
  • 20
  • 105
  • 125
1
vote
1 answer

FastJson with putDeserializer leads to StackOverflowError

Deserializing object using FastJson with putDeserializer leads to StackOverflowError. What am I doing wrong? test.json { "openapi": "3.0.1", "info": { "title": "Swagger Petstore", "version": "1.0.0", "description": "This is a sample…
阿尔曼
  • 1,275
  • 2
  • 14
  • 18
1
vote
1 answer

@JSONField it did not work in spring boot

I use @JSONField annotation for pointX and pointY, I want to change pointX to point_x! I want to pointX show like point_x! But it did not work! It always is pointX and pointY! but other field is ok! My java bean like this! @Data public class…
陈彦瑾
  • 11
  • 4
1
vote
0 answers

change values during Jackson serialization, like ValueFileter for fastjson

When I serialize a string value if it's too long, I want to change it to another value. If use FastJSON, you can use ValueFilter do it. String jsonStr = "{\"key1\":\"DMA65DEG3p4If+JLrfzUUeeMTnX3ufk57ji+thwrbdg=\",\"key2\":\"data…
tim nick
  • 11
  • 1
1
vote
0 answers

How to deserialize a list to a map using fastmap

I have a JSON that has a list of objects inside another object, something like: { "name":"name", "processes":[ { "id":123, "desc":"main" }, { "id":456, "desc":"secondary" } ] } I…
zepol
  • 187
  • 5
  • 20
1
vote
1 answer

JSON parse error: syntax error, expect {, actual error, pos 0, fastjson-version 1.2.57 when using RoyalPay SDK

I am trying to use RoyalPay SDK to create order and make Alipay payment. The response code is 200, but I cannot parse JSON in response. How do I solve this problem? The code I create api request with: interface RoyalPayApi { …
kate
  • 79
  • 1
  • 9
1
vote
1 answer

kotlin with fastjson parse object error: default constructor not found

I am trying use fastjson parse object in Kotlin code. but exception happened when I use JSON.parseObject, here are detail: My data class: import com.alibaba.fastjson.JSONObject data class StatesMessage @JvmOverloads constructor(val command:…
1
vote
1 answer

How use fastJSON with a JSON array

I am using fastJSON to read data from a JSON file that I made, (the JSON file have data of a game's levels for a project in Unity, but that is not important). This is the JSON content: {"1": { "background": "background1.png", "description":…
1
2 3 4