apiaryio / api-blueprint

API Blueprint
https://apiblueprint.org
MIT License
8.65k stars 2.14k forks source link

apiary fails to handle certain json #403

Closed robrechta closed 7 years ago

robrechta commented 7 years ago

I'm trying to document a certain json response. Somehow, I'm unable to compare my documented mson against the production json. When I launch the url, in the response: the json is somehow a String. When I launch compare, I'm getting the message At '' Invalid type: string (expected object). This is the json that is returned by my application:

{"uniqueId":"e46bc6c1-3db9-4086-9bf5-abf87572cdeb","type":"digital","chapter":"moB5JOPQTGCi2gKW7WnjfA","subject":"gib7QML0Tn2LzH9V32I2sQ","subtopic":"Pg4seqTyQP2P0KxI3FUhUw","payable":false,"content":[{"key":"contentPurpose","value":["ISLAND"]},{"key":"configs","value":[{"uniqueId":"908f8e2ae760cf7c1981ce27a7d77bc29411336f","level":"base","group":"7e67c713-839d-4246-a0be-aeae740d151b","groupCode":"15790394","properties":{"blockid":"e46bc6c1-3db9-4086-9bf5-abf87572cdeb","blockCode":"Apiary Input standard","exerciseAttributes":{"exerciseType":"input","question":"<p>Apiary Input standard</p>\n","answerContext":"<p>#1&nbsp;+ #2 &nbsp;= #3</p>\n","defaults":null,"useGrid":null,"catchAllHint":"<p>hint</p>\n","catchAllTheory":"<p>theory</p>\n","time":{"timed":false,"seconds":0},"inputIndicators":[[]],"inputAnswerGroups":[[{"name":"Default","inputAnswerOptions":[[{"groupIdentifier":null,"identifier":{"inputAnswerIdentifier":"#1"},"inputByUser":true,"hidden":false,"hintFeedbackMode":null,"theoryFeedbackMode":null,"aliases":[{"value":"1","caseSensitive":false,"shownChars":0,"inputByUser":null}]},{"groupIdentifier":null,"identifier":{"inputAnswerIdentifier":"#2"},"inputByUser":true,"hidden":false,"hintFeedbackMode":null,"theoryFeedbackMode":null,"aliases":[{"value":"2","caseSensitive":false,"shownChars":0,"inputByUser":null}]},{"groupIdentifier":null,"identifier":{"inputAnswerIdentifier":"#3"},"inputByUser":true,"hidden":false,"hintFeedbackMode":null,"theoryFeedbackMode":null,"aliases":[{"value":"3","caseSensitive":false,"shownChars":0,"inputByUser":null}]}]]},{"name":"Second group","inputAnswerOptions":[[{"groupIdentifier":null,"identifier":{"inputAnswerIdentifier":"#1"},"inputByUser":true,"hidden":false,"hintFeedbackMode":null,"theoryFeedbackMode":null,"aliases":[{"value":"2","caseSensitive":false,"shownChars":0,"inputByUser":null}]},{"groupIdentifier":null,"identifier":{"inputAnswerIdentifier":"#2"},"inputByUser":true,"hidden":false,"hintFeedbackMode":null,"theoryFeedbackMode":null,"aliases":[{"value":"1","caseSensitive":false,"shownChars":0,"inputByUser":null}]},{"groupIdentifier":null,"identifier":{"inputAnswerIdentifier":"#3"},"inputByUser":true,"hidden":false,"hintFeedbackMode":null,"theoryFeedbackMode":null,"aliases":[{"value":"3","caseSensitive":false,"shownChars":0,"inputByUser":null}]}]]}]],"inputFeedback":[[]]},"visualizationAttributes":{"visualizationType":"standard-input","numberOfIIOS":null,"useIIOS":false,"alignment":null,"flashTime":0,"numberOfRows":null,"numberOfColumns":null,"orderOfIIOS":null,"defaultInputWidth":"ONE_AND_A_HALF"},"instructionConfiguration":{"sound":null,"questionLine1":"<p>Apiary Input standard</p>\n","questionLine2":"","readSpeakerType":null}}},{"uniqueId":"1268e120caf2ac459329890ce379a5d7bfd08a32","level":"remedial","group":"7e67c713-839d-4246-a0be-aeae740d151b","groupCode":"15790394","properties":{"blockid":"e46bc6c1-3db9-4086-9bf5-abf87572cdeb","blockCode":"Apiary Input standard","exerciseAttributes":{"exerciseType":"input","question":"<p>Apiary Input standard</p>\n","answerContext":"<p>#1 is #2</p>\n","defaults":null,"useGrid":null,"catchAllHint":"<p>hint</p>\n","catchAllTheory":"<p>theory</p>\n","time":{"timed":false,"seconds":0},"inputIndicators":[[{"value":"banaan","alwaysShow":true},{"value":"appel","alwaysShow":true},{"value":"tomaat","alwaysShow":true},{"value":"fruit","alwaysShow":true},{"value":"groente","alwaysShow":true}]],"inputAnswerGroups":[[{"name":"Default","inputAnswerOptions":[[{"groupIdentifier":null,"identifier":{"inputAnswerIdentifier":"#1"},"inputByUser":true,"hidden":false,"hintFeedbackMode":null,"theoryFeedbackMode":null,"aliases":[{"value":"banaan","caseSensitive":false,"shownChars":0,"inputByUser":null}]},{"groupIdentifier":null,"identifier":{"inputAnswerIdentifier":"#2"},"inputByUser":true,"hidden":false,"hintFeedbackMode":null,"theoryFeedbackMode":null,"aliases":[{"value":"fruit","caseSensitive":false,"shownChars":0,"inputByUser":null}]}]]}]],"inputFeedback":[[]]},"visualizationAttributes":{"visualizationType":"standard-input","numberOfIIOS":5,"useIIOS":true,"alignment":"CENTER","flashTime":0,"numberOfRows":2,"numberOfColumns":3,"orderOfIIOS":"RANDOM","defaultInputWidth":"ONE_AND_A_HALF"},"instructionConfiguration":{"sound":null,"questionLine1":"<p>Apiary Input standard</p>\n","questionLine2":"","readSpeakerType":null}}}]},{"key":"numberOfQuestions","value":1},{"key":"conditionalSequencePattern","value":{"base":"2/2","remedial":"2/2","enrichment":"2/2"}},{"key":"blockNumber","value":22},{"key":"nameForTeacher","value":"Apiary Input standard"},{"key":"nameForPupil","value":"Apiary Input standard"},{"key":"configsRandomized","value":true},{"key":"remedialPresent","value":true},{"key":"enrichmentPresent","value":false},{"key":"rewardConfiguration","value":{"correctAnswerAmount":10,"correctAnswerAfterFeedbackAmount":5,"wrongAnswerAmount":2}}],"method":"W7qDNzPTTwO4iIADPx7lLA","year":"wPclmk6WRfe8nMfM69drYA"}

The body that is shown in the apiary (online editor)

"{\"uniqueId\":\"e954cee0-c96f-42b9-b8dd-b2bab7788096\",\"type\":\"digital\",\"chapter\":\"E5D39EF3-3BEC-4C72-BFAD-D6C74FAE8B1A\",\"subject\":\"D992DBDB-CF28-44A6-8839-CAC282A4993A\",\"subtopic\":\"Ip6KTtTxRlSkRWil3XEOxQ\",\"payable\":false,\"content\":[{\"key\":\"contentPurpose\",\"value\":[\"ISLAND\"]},{\"key\":\"configs\",\"value\":[{\"uniqueId\":\"86982e0a7854faa6c1bd0f0a69105ce02f1c8869\",\"level\":\"base\",\"group\":\"6e8ca2e1-f7b5-41aa-9fd5-5e92c0922ed1\",\"groupCode\":\"15750571\",\"properties\":{\"blockid\":\"e954cee0-c96f-42b9-b8dd-b2bab7788096\",\"blockCode\":\"ETSL beam\",\"exerciseAttributes\":{\"exerciseType\":\"single-choice\",\"question\":null,\"time\":{\"timed\":false,\"seconds\":0},\"options\":{\"orderChoices\":\"random\",\"numberOfAnswerOptions\":2},\"answers\":[[{\"id\":15785315,\"text\":\"<p>twee</p>\\n\",\"correct\":true,\"hint\":\"<p>THis is the hint information</p>\\n\",\"theory\":\"<p>Thgis is the theory information</p>\\n\"},{\"id\":15785316,\"text\":\"<p>drie</p>\\n\",\"correct\":false,\"hint\":\"<p>THis is the hint information</p>\\n\",\"theory\":\"<p>Thgis is the theory information</p>\\n\"}]]},\"visualizationAttributes\":{\"visualizationType\":\"beam\",\"colour\":\"Laser_01_png\",\"emitter\":\"Grade1_Emitter_png\",\"console\":\"Grade1_Controller_Beam_png\"},\"instructionConfiguration\":{\"sound\":null,\"questionLine1\":\"<p>Duid het juiste antwoord aan</p>\",\"questionLine2\":\"\",\"readSpeakerType\":\"DUTCH\"}}},{\"uniqueId\":\"8c04c1a9d29975dc2847c6e4629d2c3656664808\",\"level\":\"remedial\",\"group\":\"6e8ca2e1-f7b5-41aa-9fd5-5e92c0922ed1\",\"groupCode\":\"15750571\",\"properties\":{\"blockid\":\"e954cee0-c96f-42b9-b8dd-b2bab7788096\",\"blockCode\":\"ETSL beam\",\"exerciseAttributes\":{\"exerciseType\":\"single-choice\",\"question\":null,\"time\":{\"timed\":false,\"seconds\":0},\"options\":{\"orderChoices\":\"random\",\"numberOfAnswerOptions\":2},\"answers\":[[{\"id\":15750589,\"text\":\"<p>twee</p>\\n\",\"correct\":true,\"hint\":\"<p>dqf</p>\\n\",\"theory\":\"\"},{\"id\":15750590,\"text\":\"<p>drie</p>\\n\",\"correct\":false,\"hint\":\"<p>dqf</p>\\n\",\"theory\":\"\"}]]},\"visualizationAttributes\":{\"visualizationType\":\"beam\",\"colour\":\"Laser_01_png\",\"emitter\":\"Grade1_Emitter_png\",\"console\":\"Grade1_Controller_Beam_png\"},\"qHelpConfiguration\":{\"hint\":\"<p>test</p>\\n\",\"theory\":\"\"},\"instructionConfiguration\":{\"sound\":null,\"questionLine1\":\"<p>Duid het juiste antwoord aan</p>\",\"questionLine2\":\"\",\"readSpeakerType\":\"DUTCH\"}}},{\"uniqueId\":\"7c5530f0b754154aa8b5122ae3d0ec148276c96d\",\"level\":\"enrichment\",\"group\":\"6e8ca2e1-f7b5-41aa-9fd5-5e92c0922ed1\",\"groupCode\":\"15750571\",\"properties\":{\"blockid\":\"e954cee0-c96f-42b9-b8dd-b2bab7788096\",\"blockCode\":\"ETSL beam\",\"exerciseAttributes\":{\"exerciseType\":\"single-choice\",\"question\":null,\"time\":{\"timed\":false,\"seconds\":0},\"options\":{\"orderChoices\":\"random\",\"numberOfAnswerOptions\":2},\"answers\":[[{\"id\":15750596,\"text\":\"<p>twee</p>\\n\",\"correct\":true,\"hint\":\"<p>dqfq</p>\\n\",\"theory\":\"\"},{\"id\":15750597,\"text\":\"<p>drie</p>\\n\",\"correct\":false,\"hint\":\"<p>dqfq</p>\\n\",\"theory\":\"\"}]]},\"visualizationAttributes\":{\"visualizationType\":\"beam\",\"colour\":\"Laser_01_png\",\"emitter\":\"Grade1_Emitter_png\",\"console\":\"Grade1_Controller_Beam_png\"},\"instructionConfiguration\":{\"sound\":null,\"questionLine1\":\"<p>Duid het juiste antwoord aan</p>\",\"questionLine2\":\"\",\"readSpeakerType\":\"DUTCH\"}}},{\"uniqueId\":\"eee52a8aa13d2604af5c8301fc9fca4e96cc0d5c\",\"level\":\"base\",\"group\":\"5d19c7fa-1925-4373-870b-b6c7edd24eea\",\"groupCode\":\"15785140\",\"properties\":{\"blockid\":\"e954cee0-c96f-42b9-b8dd-b2bab7788096\",\"blockCode\":\"ETSL beam\",\"exerciseAttributes\":{\"exerciseType\":\"single-choice\",\"question\":null,\"time\":{\"timed\":false,\"seconds\":0},\"options\":{\"orderChoices\":\"random\",\"numberOfAnswerOptions\":2},\"answers\":[[{\"id\":15785142,\"text\":\"<p>twee</p>\\n\",\"correct\":true,\"hint\":\"<p>dqfq</p>\\n\",\"theory\":\"\"},{\"id\":15785143,\"text\":\"<p>drie</p>\\n\",\"correct\":false,\"hint\":\"<p>dqfq</p>\\n\",\"theory\":\"\"}]]},\"visualizationAttributes\":{\"visualizationType\":\"beam\",\"colour\":\"Laser_01_png\",\"emitter\":\"Grade1_Emitter_png\",\"console\":\"Grade1_Controller_Beam_png\"},\"instructionConfiguration\":{\"sound\":null,\"questionLine1\":\"<p>Duid het juiste antwoord aan</p>\",\"questionLine2\":\"\",\"readSpeakerType\":\"DUTCH\"}}},{\"uniqueId\":\"afd4a17ceb1526ebbd9d1133d4d5161b27bc97b5\",\"level\":\"remedial\",\"group\":\"5d19c7fa-1925-4373-870b-b6c7edd24eea\",\"groupCode\":\"15785140\",\"properties\":{\"blockid\":\"e954cee0-c96f-42b9-b8dd-b2bab7788096\",\"blockCode\":\"ETSL beam\",\"exerciseAttributes\":{\"exerciseType\":\"single-choice\",\"question\":null,\"time\":{\"timed\":false,\"seconds\":0},\"options\":{\"orderChoices\":\"random\",\"numberOfAnswerOptions\":2},\"answers\":[[{\"id\":15785148,\"text\":\"<p>twee</p>\\n\",\"correct\":true,\"hint\":\"<p>dqf</p>\\n\",\"theory\":\"\"},{\"id\":15785149,\"text\":\"<p>drie</p>\\n\",\"correct\":false,\"hint\":\"<p>dqf</p>\\n\",\"theory\":\"\"}]]},\"visualizationAttributes\":{\"visualizationType\":\"beam\",\"colour\":\"Laser_01_png\",\"emitter\":\"Grade1_Emitter_png\",\"console\":\"Grade1_Controller_Beam_png\"},\"qHelpConfiguration\":{\"hint\":\"<p>test</p>\\n\",\"theory\":\"\"},\"instructionConfiguration\":{\"sound\":null,\"questionLine1\":\"<p>Duid het juiste antwoord aan</p>\",\"questionLine2\":\"\",\"readSpeakerType\":\"DUTCH\"}}},{\"uniqueId\":\"81b47c66f4c57b520df7f7789bec638254f110fa\",\"level\":\"enrichment\",\"group\":\"5d19c7fa-1925-4373-870b-b6c7edd24eea\",\"groupCode\":\"15785140\",\"properties\":{\"blockid\":\"e954cee0-c96f-42b9-b8dd-b2bab7788096\",\"blockCode\":\"ETSL beam\",\"exerciseAttributes\":{\"exerciseType\":\"single-choice\",\"question\":null,\"time\":{\"timed\":false,\"seconds\":0},\"options\":{\"orderChoices\":\"random\",\"numberOfAnswerOptions\":2},\"answers\":[[{\"id\":15785145,\"text\":\"<p>twee</p>\\n\",\"correct\":true,\"hint\":\"<p>dqfq</p>\\n\",\"theory\":\"\"},{\"id\":15785146,\"text\":\"<p>drie</p>\\n\",\"correct\":false,\"hint\":\"<p>dqfq</p>\\n\",\"theory\":\"\"}]]},\"visualizationAttributes\":{\"visualizationType\":\"beam\",\"colour\":\"Laser_01_png\",\"emitter\":\"Grade1_Emitter_png\",\"console\":\"Grade1_Controller_Beam_png\"},\"instructionConfiguration\":{\"sound\":null,\"questionLine1\":\"<p>Duid het juiste antwoord aan</p>\",\"questionLine2\":\"\",\"readSpeakerType\":\"DUTCH\"}}}]},{\"key\":\"numberOfQuestions\",\"value\":1},{\"key\":\"conditionalSequencePattern\",\"value\":{\"base\":\"2/2\",\"remedial\":\"2/2/9\",\"enrichment\":\"2/2\"}},{\"key\":\"blockNumber\",\"value\":1},{\"key\":\"nameForTeacher\",\"value\":\"ETSL beam\"},{\"key\":\"nameForPupil\",\"value\":\"ETSL beam\"},{\"key\":\"configsRandomized\",\"value\":true},{\"key\":\"remedialPresent\",\"value\":true},{\"key\":\"enrichmentPresent\",\"value\":true},{\"key\":\"rewardConfiguration\",\"value\":{\"correctAnswerAmount\":2,\"correctAnswerAfterFeedbackAmount\":2,\"wrongAnswerAmount\":1}}],\"method\":\"4DF3CAD3-DED0-4507-A537-462831C915CD\",\"year\":\"ED34E063-1E1F-4C9B-AE57-B21FB9A21332\"}"

When I go to the inspector, then the response body that is shown is a little bit smaller then expected:

{
  "uniqueId": "e954cee0-c96f-42b9-b8dd-b2bab7788096",
  "type": "digital",
  "chapter": "E5D39EF3-3BEC-4C72-BFAD-D6C74FAE8B1A",
  "subject": "D992DBDB-CF28-44A6-8839-CAC282A4993A",
  "subtopic": "Ip6KTtTxRlSkRWil3XEOxQ",
  "payable": false,
  "content": [
    {
      "key": "contentPurpose",
      "value": []
    }
  ],
  "method": "4DF3CAD3-DED0-4507-A537-462831C915CD",
  "year": "ED34E063-1E1F-4C9B-AE57-B21FB9A21332"
}

--> the "content" object with key 'contentPurpose' his value is missing, and all the other objects in "content" are missing. The Json seems valid to me, so I don't know what's going wrong...

Some screenshots that illustrate the problem: Calling api response-json Compare compare Inspector inspector

kylef commented 7 years ago

@robrechta you mentioned that you are using MSON. Could you please share that MSON structure.

robrechta commented 7 years ago

okey, I don't see what the typed mson has to do with parsing a response, but I'll give it. I hope it helps :-)

## Beam block [/api/publishing/EXERCISE_BLOCK/e954cee0-c96f-42b9-b8dd-b2bab7788096]

### Get json [GET]
+ Response 200 (application/json)
    + Attributes (ExerciseBlock)

Data structure:

# Data Structures

## `time` (object)
+ `timed`: `false` (boolean) 
+ `seconds`: `0` (number) 

## `SingleChoiceOptions` (object)
+ `orderChoices`: `random` (string)
+ `numberOfAnswerOptions`: `2` (number)

## `SingleChoiceAnswer` (object)
+ `id`: `15777688` (number) 
+ `text`: `<p>a</p>` (string)
+ `correct`: true (boolean)
+ `hint`: `<p>This is the hint information</p>` (string)
+ `theory`: '<p>This is the theory information</p>' (string)

## `Alias` (object)
- `value`: `banaan` (string)
- `caseSensitive`: `false` (boolean)
- `shownChars`: `0` (number)
- `inputByUser` (object)

## `InputAnswerOption` (object)
+ `groupIdentifier` : null (string, nullable)
+ `identifier` (object)
    + `inputAnswerIdentifier`: `#1` (string)
+ `inputByUser`: true (boolean)
+ `hidden`: false (boolean)
+ `hintFeedbackMode` (object)
+ `theoryFeedbackMode` (object)
+ `aliases` (array)
    + (Alias)

## `InputAnswerGroup` (object)
+ `name`: `Default` (string)
+ `inputAnswerOptions` (array)
    + (array)
        + (InputAnswerOption)

## `SingleChoiceExerciseAttributes` (object)
+ `exerciseType`: `single-choice` (string)
+ `question`: `<p>Some exercise question</p>` (string) 
+ `time` (time)
+ `options` (SingleChoiceOptions)
+ `answers` (array)
    + (array)
        + (SingleChoiceAnswer)
            + `id`: `1000` (number)
            + `correct`: true (boolean)
        + (SingleChoiceAnswer)
            + `id`: `2000` (number) 
            + `correct`: false (boolean)

## `BeamVisualizationAttributes` (object)
+ `visualizationType`: `beam` (string) 
+ `colour`: `Laser_01_png` (string) 
+ `emitter`: `Grade1_Emitter_png` (string) 
+ `console`: `Grade1_Controller_Beam_png` (string) 

## `instructionConfiguration` (object)
+ `sound` : null (string, nullable) 
+ `questionLine1`: `<p>Duid het juiste antwoord aan</p>` (string)
+ `questionLine2` (string) 
+ `readSpeakerType`: `DUTCH` (string) 

## `ExerciseConfigProperties` (object)
+ `blockid`: `e954cee0-c96f-42b9-b8dd-b2bab7788096` (string) 
+ `blockCode`: `ETSL beam` (string) 
+ `exerciseAttributes` (SingleChoiceExerciseAttributes)
+ `visualizationAttributes` (BeamVisualizationAttributes) 
+ `instructionConfiguration` (instructionConfiguration) 

## `ExerciseConfig` (object)
+ `uniqueId`: `86982e0a7854faa6c1bd0f0a69105ce02f1c8869` (string) 
+ `level`: `base` (string) 
+ `group`: `6e8ca2e1-f7b5-41aa-9fd5-5e92c0922ed1` (string) 
+ `groupCode`: `15750571` (string) 
+ `properties` (ExerciseConfigProperties) 

## `ContentPurpose` (object)
+ `key`: `contentPurpose` (string)
+ `value` (array[string]) 

## `NumberOfQuestions` (object)
+ `key`: `numberOfQuestions` (string) 
+ `value`: `1` (number) 

## `ConditionalSequencePattern` (object)
+ `key`: `conditionalSequencePattern` (string)
+ `value`
    + `base`: `2/2`
    + `remedial`: `2/2/3` 
    + `enrichment`: `3/3` 

## `BlockNumber` (object)
+ `key`: `blockNumber` (string)
+ `value`: `0` (number)

## `NameForTeacher` (object)
+ `key`: `nameForTeacher` (string) 
+ `value`: `ETSL beam` (string) 

## `NameForPupil` (object)
+ `key`: `nameForPupil` (string) 
+ `value`: `ETSL beam` (string) 

## `ConfigsRandomized` (object)
+ `key`: `configsRandomized` (string) 
+ `value`: true (boolean) 

## `RemedialPresent` (object)
+ `key`: `remedialPresent` (string) 
+ `value`: true (boolean) 

## `EnrichmentPresent` (object)
+ `key`: `enrichmentPresent` (string) 
+ `value`: true (boolean) 

## `RewardConfiguration` (object)
+ `key`: `rewardConfiguration` (string) 
+ `value`
    + `correctAnswerAmount` (number) 
    + `correctAnswerAfterFeedbackAmount` (number) 
    + `wrongAnswerAmount` (number) 

## ExerciseBlock
+ uniqueId: `e954cee0-c96f-42b9-b8dd-b2bab7788096` (string) 
+ type: `digital` (string)
+ method: `4DF3CAD3-DED0-4507-A537-462831C915CD` (string) 
+ year: `ED34E063-1E1F-4C9B-AE57-B21FB9A21332` (string) 
+ chapter: `E5D39EF3-3BEC-4C72-BFAD-D6C74FAE8B1A` (string)
+ subject: `D992DBDB-CF28-44A6-8839-CAC282A4993A` (string) 
+ subtopic: `Ip6KTtTxRlSkRWil3XEOxQ` (string) 
+ payable: `false` (boolean)
+ content (array)
    + (ContentPurpose)
    + (object)
        + `key`: `configs` (string)
        + `value` (array)
            + (ExerciseConfig) 
    + (NumberOfQuestions)
    + (ConditionalSequencePattern)
    + (BlockNumber)
    + (NameForTeacher)
    + (NameForPupil)
    + (ConfigsRandomized)
    + (RemedialPresent)
    + (EnrichmentPresent)
    + (RewardConfiguration)
kylef commented 7 years ago

The specific message At '' Invalid type: string (expected object) I believe is regarding validating the response against the JSON Schema (derived from the MSON).

Let me dig into this and try and reproduce, I'll get back to you once I know more.

kylef commented 7 years ago

@robrechta Could it be possible that your production is returning double JSON encoded response? I.e, it's returning a JSON string which is serialised JSON.

exports.endpoint = function(request, response) {
    response.end(JSON.stringify(JSON.stringify({"test": "test"})));
}
$ curl https://untitled-5qqqzw6bm1rr.runkit.sh
"{\"test\":\"test\"}"

The only way I can reproduce similar behaviour is while doing so. Otherwise perhaps there could be a problem on Apiary side and there is some way that the response is getting coerced to JSON.

robrechta commented 7 years ago

@kylef I thought that too, but when requesting the json in a browser, the json is like {"test": "test"} .... Ha, you are using curl to verify. .... Damned, when I trying to use curl it is like you said: "{\"uniqueId\":\"e46bc6c1-3db9-4086-9bf5-abf87572cdeb\"... don't know why I didn't see that in chrome or firefox...

Ok, I can fix the backend that builds the json, and see what happens... I'll keep you posted...

robrechta commented 7 years ago

@kylef it is fixed on our side, thx for the support. Edit (for anybody else who read this): The backend is a spring project, and we stumbled againts: https://stackoverflow.com/questions/15507064/return-literal-json-strings-in-spring-mvc-responsebody Adding a stringHttpMessageConverter before jackson solved the issue.