Jason is a JSON parsing library for Elixir. See https://github.com/michalmuskala/jason
Questions tagged [elixir-jason]
33 questions
2
votes
1 answer
How to have custom enconding for struct using Jason?
Background
I am trying to encode a structure into json format using the Jason library. However, this is not working as expected.
Code
Let's assume I have this struct:
defmodule Test do
defstruct [:foo, :bar, :baz]
end
And that when using…

Flame_Phoenix
- 16,489
- 37
- 131
- 266
1
vote
1 answer
get array content from json (telegram api) in php
I have this json code
"result": [
{
"update_id": 74783732,
"message": {
"message_id": 852,
"from": {
"id": ---,
"is_bot": false,
"first_name": "---",
"username": "---",
"language_code": "en"
},
"chat": {
"id": ---,
"first_name": "---",
"username":…

Erik
- 13
- 3
1
vote
1 answer
Convert a jason file to a matrix form
I apologize in advance if my question is too standard. I tried my best to google the answer but could not find a satisfying one.
I have a distance matrix file in Jason with the following format
{"A": {"A":0, "B": 1, "C": 2}, "B":{"A": 1, "B": 0,…

tungprime
- 51
- 1
- 5
1
vote
1 answer
how to get values from nested JSON object in ajax with c#
JSON result is coming as below.
{
"id": 8,
"name": "ads",
"productCategoryMappings": [
{
"id": 3,
"categoryId": 21,
"productId": 8,
}
]
}
How can I access categoryId in AJAX success
I can access result.name but can…

mohtashim
- 11
- 3
1
vote
1 answer
Jason decode twice to pattern match correctly
I'm really new to elixir, so forgive my ignorance. I have a json response in body (coming from a public api) that i need to decode twice to actually get a map that i can pattern match. I do not understand why is that happening and how to avoid it?…

KiKoS
- 428
- 1
- 7
- 18
1
vote
1 answer
Jason encode binary to UUID in Elixir
I'm trying to think of a clean way to override the JasonEncoder for binary that would allow me to pull out UUIDs from binary. Here is what I would like to do in theory:
defimpl Jason.Encoder, for: BitString do
def encode(binary, opts) when…

sdc
- 2,603
- 1
- 27
- 40
0
votes
0 answers
Agent-oriented programming
I'm currently working on Agent-oriented programming and I need to divide 10 agents into 2 groups and implement a pathfinding algorithm. I've managed to implement a random walk but the group of agents doesn't divide into 2 as expected and I can't…

Dnay4501
- 1
0
votes
0 answers
Getting the 403 forbidden error when read data from the Twitter Using APIs
I have a free Twitter account, created a project, created an app. When I extract data from the twitter using APIs I get forbidden: You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media post, oauth)…

Simon
- 1
0
votes
0 answers
I am getting multiple error when I added write json file and convert it into dart
/C:/Users/Hp/AppData/Local/Pub/Cache/hosted/pub.dev/velocity_x-4.1.0/lib/src/flutter/flex.dart:51:8: Error: A constant constructor can't call a non-constant super constructor.
}) :…
0
votes
1 answer
Problems joining two CSV tables with ID and exporting as nested JSON
Problems joining two CSV Tables over ID and exporting as a nested JSON
Hey absolute Python beginner here.
I have two tables; one containing Information over a findplace of archeological finds with a ID; then i have a second table with many coins…

Simon Holzner
- 1
- 2
0
votes
0 answers
Query to get distinct value from Jason data with in a field MySQL database
Here is solution to the problem:
SELECT DISTINCT JSON_UNQUOTE(JSON_EXTRACT(color, '$.label')) AS label from yourtable-- (get distinct value under Jason data with in a field)
SELECT DISTINCT JSON_UNQUOTE(JSON_EXTRACT(color, '$.label')) AS label from…

AM Shah
- 1
0
votes
1 answer
How to create customize AWS WAF Rate-based rule for 1min time window?
I am new to AWS WAF, we have use case where we need to block certain amount of IPs within a 1min time window ?
in breif : IP address/addresses block for 10 minutes if we are getting more than 20 Requests per
minute.
As per the current architecture ,…

mihiruk
- 1
0
votes
0 answers
How to echo an array that come from JSON data?
Hi I am totally confused about bellow array. I know this is stupid question from who been coding for over 3 year like me.
I got a respond from server I declared as variable $respond
$result = json_decode($respond, true);
var_dump($result);
// the…
0
votes
0 answers
Delphi Access violation address
procedure TWebModule2.ClientGetItem(Request: TWebRequest; Response: TWebResponse);
var
o: TJSONObject;
CfKey: string;
a:TjsonArray;
begin
CfKey:='';
CfKey:= Request.QueryFields.Values['CF'] ;
…

Nu Carvignulu
- 61
- 1
- 1
- 15
0
votes
0 answers
SpringMvc No converter fo * with persent Content-Type 'null'
I tried to write an SSM project, but when I used the Controller to return my custom object, it gave me a No converter for [class cn.pickle.entiry.Student] with preset Content-Type 'null']
error message
19-Dec-2022 17:43:13.011 警告…

pickle
- 1