You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
***type**: A _string_ or a _function_`function(relationshipData, data) { ... }` for the type to use for serializing the relationship (type need to be register).
46
46
***alternativeKey** (optional): An alternative key (string or path) to use if relationship key not exist (example: 'author_id' as an alternative key for 'author' relationship). See [issue #12](https://github.com/danivek/json-api-serializer/issues/12).
47
47
***schema** (optional): A custom schema for serializing the relationship. If no schema define, it use the default one.
48
-
***data** (optional): A _function_`function(data) { ... }` returns the data to serialize for the relationship.
48
+
***data** (optional): A _function_`function(data) { ... }`that returns the data to serialize for the relationship.
49
49
***links** (optional): Describes the links for the relationship. It can be:
50
50
* An _object_ (values can be string or function).
51
51
* A _function_ with one argument `function(data) { ... }` or with two arguments `function(data, extraData) { ... }`
Copy file name to clipboardExpand all lines: lib/JSONAPISerializer.js
+1-1
Original file line number
Diff line number
Diff line change
@@ -1000,7 +1000,7 @@ module.exports = class JSONAPISerializer {
1000
1000
* @property {string|Function} type a string or a function for the type to use for serializing the relationship (type need to be register)
1001
1001
* @property {string} [alternativeKey] an alternative key (string or path) to use if relationship key not exist (example: 'author_id' as an alternative key for 'author' relationship)
1002
1002
* @property {string} [schema] a custom schema for serializing the relationship. If no schema define, it use the default one.
1003
-
* @property {Function} [data] a function which returns the data to serialize for the relationship
1003
+
* @property {Function} [data] a function that returns the data to serialize for the relationship
1004
1004
* @property {Function|object} [links] describes the links for the relationship
1005
1005
* @property {Function|object} [meta] describes meta that contains non-standard meta-information about the relationship
1006
1006
* @property {Function} [deserialize] describes the function which should be used to deserialize a related property which is not included in the JSON:API document
0 commit comments