NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: AtoB on November 12, 2015, 04:12:45 AM

Title: webservice : field case ignored for JSON in service documentation?
Post by: AtoB on November 12, 2015, 04:12:45 AM
Hi,

I think the field case settings for (at least) the webservice documentation is ignored. I'm using Queues as return type and have external names on the fields and set the "Fieldname Case" to "AsIs", but the documentation for the JSON output shows up as uppercase. (XML output shows mixed case, so that's fine). Using Nettalk 8.65 and jFiles 1.13

first a snippet for the generated XML (correct):
  <category>
        <id>value</id>
        <label>value</label>
      </category>

and this is for the JSON:

"category" : [
      {
        "ID" : value,
        "LABEL" : "value"
      }
    ]

Don't know what the actual output is like (need to test this ...)
Title: Re: webservice : field case ignored for JSON in service documentation?
Post by: AtoB on November 16, 2015, 05:30:08 AM
Hmmm, casing seems to revert to the default (uppercase) on several places (with JSON):

- data : caseAsIs is ignored
- when there are errors in p_web.ServiceErrorQueue these are returned in uppercase (while the help, is "hardcoded" to mixed case, see "GenereateHelp Routine"

I've added the following to the BuildResultFields Routine


! Start of "Start of BuildResultFields Routine"
! [Priority 5000]
  json.TagCase = jF:CaseAsIs
  jsonResults.TagCase = jF:CaseAsIs

That seems to "fix" things.


Title: Re: webservice : field case ignored for JSON in service documentation?
Post by: Bruce on November 16, 2015, 10:43:26 PM
Because each parameter, and return value, can have a different tag case setting, I've needed to make a tweak to jFiles to best fix this issue. So grab build 1.14 of jFiles.

update: This might affect parsing of incoming Json, so hang on a bit and I'll keep you posted.

cheers
Bruce
Title: Re: webservice : field case ignored for JSON in service documentation?
Post by: AtoB on November 17, 2015, 05:21:37 AM
I haven't gotten to that bit yet, so for the moment I'm fine <g>

(but keeping an eye on it)

Thanks so far
Title: Re: webservice : field case ignored for JSON in service documentation?
Post by: Bruce on November 18, 2015, 12:21:37 AM
Build 1.15 of jFiles adds a new method, SetTagCase.
This update will be required by NT8.66 and NT9 (which call this new method).