Questions tagged [argonaut]

Argonaut is a JSON library for Scala, providing a rich library for parsing, printing and manipulation as well as convenient codecs for translation to and from scala data types.

About

Argonaut is a JSON library for Scala, providing a rich library for parsing, printing and manipulation as well as convenient codecs for translation to and from scala data types.

Argonaut is licenced under BSD3 (see LICENCE).

Links

88 questions
0
votes
1 answer

How to parse a Map[String,String] with Argonaut

I want to parse something like: { "OutputDocumentType": "receipt", "ParsedFields": { "smart_tags": "R°\nVul\nZe", "vendor": "", "vendor_terms": "", "vendor_warranty": "", …
Maurício Linhares
  • 39,901
  • 14
  • 121
  • 158
0
votes
1 answer

Decoding refract with Argonaut

I'm trying to decode json in refract-style with argonaut. Scastie: http://scastie.org/15196 Error: Attempt to decode value on failed cursor.: [*.--(meta)] I don't see why it wouldn't work, everything on meta is optional, even Meta itself. Sample…
Reactormonk
  • 21,472
  • 14
  • 74
  • 123
0
votes
0 answers

Consuming a public REST API using Argonaut

I am new into Spray and Scala. I'm currently working with the public REST API of Guild Wars 2. I would like to consume some resources (like gathering all sell and buy orders on the trading post of an item named "Bolt of Damask"). I'm using Argonaut…
Im89
  • 139
  • 1
  • 10
0
votes
0 answers

decode and encode with argonaut

I would like to use the public API of guildWars2 and decode and encode some informations . I am searching for the decode and encode withs argonauts but I did not understand well .can you explain to me the fact of using argonaut. thanks
Im89
  • 139
  • 1
  • 10
0
votes
1 answer

Extract type, key and value from Rapture JSON object

I'm using Rapture JSON with Argonaut backend (can change that if necessary). Given an arbitrary JSON string, I need to parse it as a flat object (no nested JSON objects) to ideally obtain a list of tuples (fieldName, fieldType, fieldValue) for each…
sscarduzio
  • 5,938
  • 5
  • 42
  • 54
0
votes
2 answers

Use Argonaut in Play framework with Reads and Writes

I know how to do json parsing using play json library for play application. For example I have following code: class PersonController extends Controller { case class Person(age: Int, name: String) implicit val personReads =…
ttt
  • 3,934
  • 8
  • 46
  • 85
0
votes
2 answers

Incorrect Float conversion by Argonaut.io

I convert Float field of object to json. And value 0.6 converts to 0.6000000238418579 by Argonaut. How to correct it? Simple test case to check this: import argonaut.Argonaut._ import argonaut.EncodeJson class Person(val name: Float) val person =…
Lunigorn
  • 1,340
  • 3
  • 19
  • 27
0
votes
0 answers

Validate and parsing JSON with Argonaut

I need parse some JSON into Scala instance or into error JSON. For example if I have next JSON: {"user":"us","password":"pass"} and I have constraint that "user" shouldn't be less than 3. And then I should get next error JSON: {"user":"us",…
Lunigorn
  • 1,340
  • 3
  • 19
  • 27
0
votes
1 answer

Do we need to avoid reflection when design scala libraries?

Take argonaut for example, in some of our projects, when there is the need to handle JSON, people will use argonaut for that, and hardcoding the fields, like: implicit def AddressCodecJson: CodecJson[Address] = casecodec3(Address.apply,…
Freewind
  • 193,756
  • 157
  • 432
  • 708
0
votes
2 answers

decode json to List[A] in scala with Argonaut

I have a type Wf which is case class Wf(id: Option[WfId], socId: SocId, year: Int, employment: Float) extends WithId[WfId] I have the following implicit function defining an argonaut decoder implicit def WfDecodeJson: DecodeJson[Wf] = { …
Mark
  • 3,137
  • 4
  • 39
  • 76
0
votes
1 answer

Extract specific JSON field with Scala and Argonaut

I'm trying to parse json with Scala and Argonaut. Suppose I get JSON response from other side REST service and I don't know order of json's fields in that response and the number of fields. For example, http://headers.jsontest.com/ returns JSON with…
John Ostin
  • 301
  • 2
  • 12
0
votes
2 answers

Scala Argonaut Json Array/Object

I need to create this json object using scala and argonaut: "name_value_list":{ "created_by":{ "name":"created_by", "value":"1" }, "name":{ "name":"name", "value":"The Name" …
Migue Jara
  • 67
  • 1
  • 10
0
votes
1 answer

Argonaut casecodec3?

I'm trying this simple example from the Argonaut quickstart: case class Address(street: String, number: Int, postcode: Int) object Address { // Define codecs easily from case classes implicit def AddressCodecJson: CodecJson[Address] = …
clay
  • 18,138
  • 28
  • 107
  • 192
1 2 3 4 5
6