Recent

Author Topic: LGenerics: support for JSON Type Definition  (Read 7904 times)

avk

  • Hero Member
  • *****
  • Posts: 735
Re: LGenerics: support for JSON Type Definition
« Reply #60 on: February 26, 2023, 03:57:37 pm »
Hi! Would it be possible to support comments according to the json5 standard (like as Json.NET)?

I have no such plans.

totya

  • Hero Member
  • *****
  • Posts: 719
Re: LGenerics: support for JSON Type Definition
« Reply #61 on: February 26, 2023, 04:00:56 pm »
I have no such plans.

Thank you for the answer!

avk

  • Hero Member
  • *****
  • Posts: 735
Re: LGenerics: support for JSON Type Definition
« Reply #62 on: February 26, 2023, 04:56:19 pm »
You're welcome.

AlexTP

  • Hero Member
  • *****
  • Posts: 2118
    • UVviewsoft
Re: LGenerics: support for JSON Type Definition
« Reply #63 on: February 26, 2023, 07:50:29 pm »
In my text editor CudaText I use JSON configs with allowed comments (because fpJSON has option to allow them). the option to allow them will be useful. on reading JSON.

Thaddy

  • Hero Member
  • *****
  • Posts: 12982
Re: LGenerics: support for JSON Type Definition
« Reply #64 on: February 26, 2023, 08:03:15 pm »
In my text editor CudaText I use JSON configs with allowed comments (because fpJSON has option to allow them). the option to allow them will be useful. on reading JSON.
I understand that and it is useful, but note it is actually against the nature of the Json format, which is a solution to solve the overbloat of xml. Unless comments could be stripped when on-line. Otherwise we end up with another xml, which was a bad idea in the first place.
I actually get compliments for being rude... (well, Dutch, but that is the same)

AlexTP

  • Hero Member
  • *****
  • Posts: 2118
    • UVviewsoft
Re: LGenerics: support for JSON Type Definition
« Reply #65 on: February 26, 2023, 08:18:38 pm »
For my text editor, comments are super needed. To document options: https://github.com/Alexey-T/CudaText/blob/master/app/settings_default/default.json

yes, I know the _standard_ dont allow them!

Thaddy

  • Hero Member
  • *****
  • Posts: 12982
Re: LGenerics: support for JSON Type Definition
« Reply #66 on: February 26, 2023, 08:26:11 pm »
No, the Json5 standard allows comments, but it is an extremely bad idea to send them over a line. And that was where Json was designed for.
The way you use it is local and that does not hurt, but Json was designed for data exchange, not configuration.
« Last Edit: February 26, 2023, 08:27:48 pm by Thaddy »
I actually get compliments for being rude... (well, Dutch, but that is the same)

avk

  • Hero Member
  • *****
  • Posts: 735
Re: LGenerics: support for JSON Type Definition
« Reply #67 on: February 26, 2023, 08:47:26 pm »
For my text editor, comments are super needed. To document options: https://github.com/Alexey-T/CudaText/blob/master/app/settings_default/default.json

yes, I know the _standard_ dont allow them!

BTW, I believe the JTD schema can also help get rid of the need for comments in the JSON body.
« Last Edit: February 26, 2023, 08:49:00 pm by avk »

Thaddy

  • Hero Member
  • *****
  • Posts: 12982
Re: LGenerics: support for JSON Type Definition
« Reply #68 on: February 26, 2023, 09:38:13 pm »
YES, completely right.
(btw nice work!)
I actually get compliments for being rude... (well, Dutch, but that is the same)

avk

  • Hero Member
  • *****
  • Posts: 735
Re: LGenerics: support for JSON Type Definition
« Reply #69 on: February 27, 2023, 05:58:51 am »
Oh, thanks for the kind words.

totya

  • Hero Member
  • *****
  • Posts: 719
Re: LGenerics: support for JSON Type Definition
« Reply #70 on: February 27, 2023, 08:26:35 am »
For my text editor, comments are super needed. To document options: https://github.com/Alexey-T/CudaText/blob/master/app/settings_default/default.json
yes, I know the _standard_ dont allow them!

But which standard? It is no wonder that it is supported by one of the largest json libraries, the Newtonsoft, as I have already written. The most important thing is that json was created as a human-readable standard, but they completely ruined it by not supporting the option to comment. But fortunately, many people recognize that the usability is above the standards. Anyhow, avk has already decided what he wants and I respect that.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8596
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: LGenerics: support for JSON Type Definition
« Reply #71 on: February 28, 2023, 07:12:08 am »
No, the Json5 standard allows comments
But it seems like a distinguished standalone standard that most people haven't used yet, despite whatever they claim in their website. Sending commented JSON to most APIs will return a client error.

Thaddy

  • Hero Member
  • *****
  • Posts: 12982
Re: LGenerics: support for JSON Type Definition
« Reply #72 on: February 28, 2023, 07:23:35 am »
No, the Json5 standard allows comments
But it seems like a distinguished standalone standard that most people haven't used yet, despite whatever they claim in their website. Sending commented JSON to most APIs will return a client error.
Yes, I know, hence JTD can work around that. I already pointed out that commented Json on its own is usually silly.
I actually get compliments for being rude... (well, Dutch, but that is the same)

totya

  • Hero Member
  • *****
  • Posts: 719
Re: LGenerics: support for JSON Type Definition
« Reply #73 on: February 28, 2023, 10:24:33 am »
I already pointed out that commented Json on its own is usually silly.

No, it is'nt. As I wrote, json was primarily developed as a human-readable and interpretable database/data exchange format. Dou you know, what this is mean? I don't think you understand.

The programmer is not stupid, if he knows that the receiver of the json he generates only accepts standard json, then he will not produce commentable json.

Just one example, the thousand or so jsons we got, which were generated and distributed for data exchange, are UTF8 BOM encoded, which in principle is not a standard, but since the sender is the owner, he is the standard, so I have to follow this.

Since you are not affected by json's commentability and you are bored, it is easiest to mention that "it is not standard".  O:-)

Thaddy

  • Hero Member
  • *****
  • Posts: 12982
Re: LGenerics: support for JSON Type Definition
« Reply #74 on: March 05, 2023, 04:35:29 pm »
No, it is'nt.
Yes, it is. You format Json only after receiving it. Period.
I actually get compliments for being rude... (well, Dutch, but that is the same)

 

TinyPortal © 2005-2018