NetTalk Central

Author Topic: webservice : field case ignored for JSON in service documentation?  (Read 3883 times)

AtoB

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
    • Email
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 ...)

AtoB

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
    • Email
Re: webservice : field case ignored for JSON in service documentation?
« Reply #1 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.



Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: webservice : field case ignored for JSON in service documentation?
« Reply #2 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
« Last Edit: November 17, 2015, 12:08:29 AM by Bruce »

AtoB

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
    • Email
Re: webservice : field case ignored for JSON in service documentation?
« Reply #3 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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: webservice : field case ignored for JSON in service documentation?
« Reply #4 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).