skip to Main Content

Why can't Python decode this valid JSON with escaped quotes?

I have this almost JSON which has something that's only similar to JSON inside: TEST_LINE = """Oct 21 22:39:28 GMT [TRACE] (Carlos-288) org.some.awesome.LoggerFramework RID=8e9076-4dd9-ec96-8f35-bde193498f: { "service": "MyService", "operation": "queryShowSize", "requestID": "8e9076-4dd9-ec96-8f35-bde193498f", "timestamp": 1634815968000, "parameters": [ { "__type": "org.some.awsome.code.service#queryShowSizeRequest", "externalID": {…

VIEW QUESTION

How do you properly deserialize a class that has an IReadOnlyCollection<T> using System.Text.Json?

I have the following class: public sealed class SomeClass { [JsonConstructor()] public SomeClass(IEnumerable<string> myItems) { InternalMyItems = new Collection<string>(myItems.ToArray()); MyItems = new ReadOnlyCollection<string>(InternalMyItems); } public IReadOnlyCollection<string> MyItems { get; } private Collection<string> InternalMyItems { get; } } Serialization seems to…

VIEW QUESTION

Golang gin receive json data and image

I have this code for request handler: func (h *Handlers) UpdateProfile() gin.HandlerFunc { type request struct { Username string `json:"username" binding:"required,min=4,max=20"` Description string `json:"description" binding:"required,max=100"` } return func(c *gin.Context) { var updateRequest request if err := c.BindJSON(&updateRequest); err != nil…

VIEW QUESTION
Back To Top
Search