[fpc-pascal] Re: [fpc-devel] FPJSONRTTI: Case insensitive.

Michael Van Canneyt michael at freepascal.org
Thu Jan 24 18:41:23 CET 2013



On Thu, 24 Jan 2013, silvioprog wrote:

> Hello,
> 
> I have this JSON:
> 
> { "id": 1, "name": "Silvio Clécio" }

JSON is JavaScript and JavaScript *is* case sensitive.

But you can use TJSONObject.IndexOfName with CaseInsentive to True:

     Function IndexOfName(const AName: TJSONStringType; CaseInsensitive : Boolean = False): Integer;

Line 450 of fpjsonrtti could be changed to set this to True, but it will have a bad impact on performance.
Maybe we can have a property for this.

You should fix your incoming JSON instead.

Michael.


More information about the fpc-pascal mailing list