Re: Json Help

2023-09-12 Thread Christian Köstlin via Digitalmars-d-learn
On 10.09.23 13:06, Vino wrote: Hi All,   Request your help on the below code,I am trying to convert the below string to json and it always throws the error, if the below can be accomplished with any other json package even that is fine, I tired only the std.json package. Test Program: Work

Re: Json output to container

2020-10-31 Thread Vino via Digitalmars-d-learn
On Friday, 30 October 2020 at 19:33:43 UTC, Paul Backus wrote: On Friday, 30 October 2020 at 19:07:20 UTC, Vino wrote: [...] Here's a working version of the code from your original post: import asdf : parseJson; import std.algorithm; import std.container.array; import std.stdio : writeln; imp

Re: Json output to container

2020-10-30 Thread Paul Backus via Digitalmars-d-learn
On Friday, 30 October 2020 at 19:07:20 UTC, Vino wrote: Requirement: parse the json string and store the output to a container. From, Vino.B Here's a working version of the code from your original post: import asdf : parseJson; import std.algorithm; import std.container.array; import std.s

Re: Json output to container

2020-10-30 Thread Vino via Digitalmars-d-learn
On Friday, 30 October 2020 at 19:07:20 UTC, Vino wrote: On Friday, 30 October 2020 at 18:41:35 UTC, Paul Backus wrote: On Friday, 30 October 2020 at 10:23:22 UTC, Vino wrote: Hi, Request your help on the below code [...] .filter!(a => a.(["items"].byElement)) What exactly ar

Re: Json output to container

2020-10-30 Thread Vino via Digitalmars-d-learn
On Friday, 30 October 2020 at 18:41:35 UTC, Paul Backus wrote: On Friday, 30 October 2020 at 10:23:22 UTC, Vino wrote: Hi, Request your help on the below code [...] .filter!(a => a.(["items"].byElement)) What exactly are you trying to accomplish with this `a.(stuff)` syntax?

Re: Json output to container

2020-10-30 Thread Paul Backus via Digitalmars-d-learn
On Friday, 30 October 2020 at 10:23:22 UTC, Vino wrote: Hi, Request your help on the below code [...] .filter!(a => a.(["items"].byElement)) What exactly are you trying to accomplish with this `a.(stuff)` syntax? As I'm sure you've discovered, it is not valid D, but it appea

Re: Json output to container

2020-10-30 Thread Vino via Digitalmars-d-learn
On Friday, 30 October 2020 at 17:56:22 UTC, Andre Pany wrote: On Friday, 30 October 2020 at 10:23:22 UTC, Vino wrote: Hi, Request your help on the below code Code: import asdf: parseJson; import std.algorithm; import std.container.array; import std.stdio: writeln; import std.typecons: Tuple

Re: Json output to container

2020-10-30 Thread Andre Pany via Digitalmars-d-learn
On Friday, 30 October 2020 at 10:23:22 UTC, Vino wrote: Hi, Request your help on the below code Code: import asdf: parseJson; import std.algorithm; import std.container.array; import std.stdio: writeln; import std.typecons: Tuple, tuple; void main() { string apidata1 = `{"items": [

Re: Json

2017-11-19 Thread bauss via Digitalmars-d-learn
On Sunday, 19 November 2017 at 10:50:58 UTC, Mafi wrote: On Saturday, 18 November 2017 at 14:25:58 UTC, kerdemdemir wrote: I am using vibe.d's json(http://vibed.org/api/vibe.data.json/) module without a problem and really happy with it. There are also some examples(https://github.com/vibe-d/vi

Re: Json

2017-11-19 Thread Mafi via Digitalmars-d-learn
On Saturday, 18 November 2017 at 14:25:58 UTC, kerdemdemir wrote: I am using vibe.d's json(http://vibed.org/api/vibe.data.json/) module without a problem and really happy with it. There are also some examples(https://github.com/vibe-d/vibe.d/tree/master/examples/json). If you are using "dub" pa

Re: Json

2017-11-18 Thread kerdemdemir via Digitalmars-d-learn
I am using vibe.d's json(http://vibed.org/api/vibe.data.json/) module without a problem and really happy with it. There are also some examples(https://github.com/vibe-d/vibe.d/tree/master/examples/json). If you are using "dub" package manager it is also very easy to integrate vibe.d.

Re: Json

2017-11-18 Thread bauss via Digitalmars-d-learn
On Friday, 17 November 2017 at 19:12:04 UTC, Jonathan M Davis wrote: On Friday, November 17, 2017 19:02:12 Mafi via Digitalmars-d-learn wrote: [...] I've typically used http://code.dlang.org/packages/std_data_json which comes from vibe.d and was a candidate for replacing std.json - though it

Re: Json

2017-11-17 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, November 17, 2017 19:02:12 Mafi via Digitalmars-d-learn wrote: > What is the current best practice for parsing JSON in D? What > library (on code.dlang.org) should I use? > > I do not want to (de-)serialize structs. Instead I want a simple > DOM-API. > > Thank you very much :) I've typi

Re: JSON decode?

2016-09-27 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 27 September 2016 at 10:45:45 UTC, Andre Pany wrote: Hi, from a rest call I get a JSON with a strange format: {"DEPLOY_ATTRIBUTES":"{\n \"dependency-type\": \"soft\"\n}","MTA_METADATA":"{\n \"id\":... The sub objects are enclosed with quotes and there are a lot of line break c

Re: JSON Serialization with runtime filtering.

2016-07-25 Thread Alexander Milushev via Digitalmars-d-learn
On Saturday, 23 July 2016 at 21:30:52 UTC, yawniek wrote: On Friday, 22 July 2016 at 12:36:31 UTC, Alexander Milushev wrote: I there any json serialization library which allow to make decision about ignoring fields in runtime? I trying to write rest client but server accept either 'cmd' or 'arg

Re: JSON Serialization with runtime filtering.

2016-07-23 Thread yawniek via Digitalmars-d-learn
On Friday, 22 July 2016 at 12:36:31 UTC, Alexander Milushev wrote: I there any json serialization library which allow to make decision about ignoring fields in runtime? I trying to write rest client but server accept either 'cmd' or 'args' field for example and I need to find solution. can yo

Re: Json

2015-06-11 Thread Cassio Butrico via Digitalmars-d-learn
On Friday, 12 June 2015 at 00:56:45 UTC, Ali Çehreli wrote: On 06/11/2015 04:58 PM, Cassio Butrico wrote: What does the .json file and how to use it? There is also the .json file that is produced by dmd's -X command line switch: dmd -X foo.d That outputs the members of the source code

Re: Json

2015-06-11 Thread Ali Çehreli via Digitalmars-d-learn
On 06/11/2015 04:58 PM, Cassio Butrico wrote: What does the .json file and how to use it? There is also the .json file that is produced by dmd's -X command line switch: dmd -X foo.d That outputs the members of the source code to foo.json in a way that may be useful for a tool. Ali

Re: Json

2015-06-11 Thread Dennis Ritchie via Digitalmars-d-learn
On Friday, 12 June 2015 at 00:35:35 UTC, Cassio Butrico wrote: Thank you for answering me so fast , where do I get the DUB for windows ? http://code.dlang.org/download

Re: Json

2015-06-11 Thread Cassio Butrico via Digitalmars-d-learn
Thank you for answering me so fast , where do I get the DUB for windows ?

Re: Json

2015-06-11 Thread Dennis Ritchie via Digitalmars-d-learn
On Thursday, 11 June 2015 at 23:58:33 UTC, Cassio Butrico wrote: What does the .json file and how to use it? In D a file with the extension *.json is used to describe packets that are included in your project, the dependency manager DUB. For example, you can install Eclipse with DDT and crea