Skip to content

Commit

Permalink
fix!: only camelCase object keys when a schema is specified for the v…
Browse files Browse the repository at this point in the history
…alue (#83)
  • Loading branch information
childish-sambino committed Apr 14, 2020
1 parent c145f03 commit 42d94fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/services/api-schema/twilio-converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ class TwilioSchemaConverter extends JsonSchemaConverter {
propValue = this.convertSchema(propSchema, propValue);
}

return { propName: camelCase(propName), propValue };
if (propSchema) {
propName = camelCase(propName);
}

return { propName, propValue };
}

convertString(schema, value) {
Expand Down
2 changes: 1 addition & 1 deletion test/services/api-schema.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('services', () => {
dateCreated: new Date('September 15, 2008 15:53 GMT+0500'),
dateUpdated: new Date('September 15, 2008 15:53 GMT+0500'),
messageType: ['not', 'a', 'message'],
freeFormObj: { firstKey: 'first_value', secondKey: 'second_value' },
freeFormObj: { first_key: 'first_value', second_key: 'second_value' },
someUri: '/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json'
};

Expand Down

0 comments on commit 42d94fd

Please sign in to comment.