9,831 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
72
views
Parsing Streaming response from OpenAI using Retrofit and Gson/Moshi
I'm trying to parse the response from OpenAI transcription API with streaming enabled.
The request is:
curl https://api.openai.com/v1/audio/transcriptions \
-H "Authorization: Bearer $...
0
votes
1
answer
73
views
Exclude map name when parsing GSon to JSON
I have something like this:
String data = new Gson().toJson(myCoolObject);
myCoolObject has a HashMap. The resulting string ends up containing not just the keys and values of the map, but also the ...
0
votes
3
answers
116
views
How to convert a JSON array to a Java list and handle JSON null values that's going to an int varible?
TL;DR: when my JSON array is converted to a list of Java objects, the null values in the JSON string is converted to 0 instead of staying as null.
I want to keep them as null in the Java object.
I ...
0
votes
3
answers
149
views
403 Response for Presigned S3 PutObject URL
I'm getting a 403 response when trying to use a presigned S3 put object URL in a Javascript fetch call. Here's what I've verified:
The IAM role that generates the presigned URL can upload an object ...
0
votes
0
answers
68
views
caching a serialized immutable object in Jackson
Use case
Say I have an HTTP endpoint that constructs an immutable object then sends that immutable object to multiple sinks. Maybe I send it to a couple of message brokers, other HTTP endpoints, a ...
1
vote
2
answers
111
views
Class BlockBlobClient declares multiple JSON fields named 'client' in Function App Blob Trigger
I'm trying to create a Function App to be triggered by blob storage events, and would like to retrieve the file metadata fields to use as parameters to file processing logic.
But when I declare @...
0
votes
1
answer
75
views
Using Gson fromJson() to Create Instances of Java Classes from JSON With Dynnamic @SerializedName Annotation Value
I have this JSON snippet. My problem is the key under transactions{} in this example it is set to "Request ID 000002" However this is part of a response to an API request and that value ...
crokett's user avatar
- 1,244
0
votes
0
answers
43
views
Kubernetes Java Client (OpenAPI) fails to deserialize JSON response in Spark context
Spark Application Running in Kubernetes Cluster.
The Spark context is initialized by the Google Spark Operator.
Spark dependencies are:
"org.apache.spark" %% "spark-hadoop-cloud" ...
2
votes
1
answer
214
views
Why can't I "requires com.google.gson" when using gson-2.13.1.jar in Eclipse 2024-12 without having to rename the file?
Hardware/Software setup:
IDE: Eclipse IDE Version 2024-12 (4.34.0)
JDK: jdk-21
OS: Windows 11 Pro 24H2
CPU: 12th Gen Intel(R) Core(TM) i5-12600KF
Background/Project Configuration
I created a ...
3
votes
2
answers
115
views
Deserialize numbers strictly in Gson
I want to make Gson deserializing numbers strictly, for example when Gson receives "123" and needs to deserialize it to Int, it must throw an exception and not automatically convert the ...
0
votes
1
answer
54
views
Gson custom serializer for PublicKey is never called [duplicate]
Here is the serializer for java.security.PublicKey:
public class PublicKeySerializer implements JsonSerializer<PublicKey> {
@Override
public JsonElement serialize(PublicKey key, Type ...
0
votes
1
answer
57
views
How to get XmlEnumValue in gson conversions?
I use gson.toJson and gson.fromGson methods. I have a class like below.
@XmlType(name = "CBPR_CancellationReasonCode")
@XmlEnum
public enum CBPRCancellationReasonCode {
DUPL("DUPL&...
0
votes
0
answers
55
views
Type com.google.gson.FieldNamingPolicy5ドル is defined multiple times
I'm working on a C# native android project using net8.0-android34.0 as framework version and one of the projects in the solution imports those android libraries:
<AndroidLibrary Update="Jars\...
-1
votes
1
answer
58
views
how to parse "key": 1b as byte using Gson?
I'm using Gson to parse a JSON string like this:
{
"key": 1b
}
However, when I parse this using JsonParser.parseString(), the value 1b is interpreted as the string "1b" instead ...
2
votes
0
answers
53
views
Lazy de-serialization of a JSON array as a Stream<T> [duplicate]
Consider I have a large (potentially infinite) array of JSON objects:
[
{
"id": 41,
"name": "foo"
},
{
"id": 42,
&...