@@ -76,7 +76,12 @@ Example:
7676 "hideIrrelevantMethods" : true ,
7777 "attributes" : {
7878 "posts" : [" title" ]
79- }
79+ },
80+ "include" : [
81+ {"methods" : " customMethod" },
82+ {"model" : " post" , "methods" : " customMethod" },
83+ {"model" : " person" , "methods" : [" customMethod1" , " customMethod2" ]}
84+ ]
8085 }
8186}
8287```
@@ -171,6 +176,31 @@ The default behavior for modifying input only applies to the following methods o
171176- ` create `
172177- ` updateAttributes `
173178
179+ ### include
180+ Allows whitelisting of methods.
181+ Define an array of whitelist objects. Whitelist objects can contain a "methods" key
182+ or both a "models" key and a "methods" key. If just the "methods" key is defined then
183+ the methods specified will be serialized or deserialized using jsonapi on all models that have
184+ the specified methods. If a combination of
185+ "model" and "methods" keys are used then the specific combination of model and methods
186+ specified will be serialized or deserialized using jsonapi.
187+
188+ #### example
189+ ``` js
190+ {
191+ ...
192+ " include" : [
193+ {" methods" : " customMethod" },
194+ {" model" : " post" , " methods" : " customMethod" },
195+ {" model" : " person" , " methods" : [" customMethod1" , " customMethod2" ]}
196+ ],
197+ ...
198+ }
199+ ```
200+
201+ - Type: ` array `
202+ - Default: ` null `
203+
174204### hideIrrelevantMethods
175205By default, ` loopback-component-jsonapi ` disables a number of methods from each endpoint
176206that are not jsonapi relevant. These methods are:
0 commit comments