@@ -67,7 +67,14 @@ Example:
6767 "loopback-component-jsonapi" : {
6868 "restApiRoot" : " /api" ,
6969 "enable" : true ,
70- "handleErrors" : true
70+ "handleErrors" : true ,
71+ "exclude" : [
72+ {"model" : " comment" },
73+ {"methods" : " find" },
74+ {"model" : " post" , "methods" : " find" },
75+ {"model" : " person" , "methods" : [" find" , " create" ]}
76+ ],
77+ "hideIrrelevantMethods" : true
7178 }
7279}
7380```
@@ -87,6 +94,49 @@ format. Validation errors include the correct properties in order to work
8794out of the box with ember.
8895Default: true
8996
97+ ### exclude
98+ Allows blacklisting of models and methods. (See example above)
99+ Define an array of blacklist objects. Blacklist objects can contain "model" key
100+ "methods" key or both. If just "model" is defined then all methods for the
101+ specified model will not use jsonapi. If just the "methods" key is defined then
102+ all methods specified on all models will be not use jsonapi. If a combination of
103+ "model" and "methods" keys are used then the specific combination of model and methods
104+ specified will not use jsonapi.
105+
106+ #### Please note
107+ The default component behavior currently is to only modify the output of the following
108+ methods on all models to be json api compliant:
109+ - find
110+ - create
111+ - updateAttributes
112+ - deleteById
113+ - findById
114+ - __ get__ .*
115+ - __ findRelationships__ .*
116+
117+ And the default current behavior for modifying input only applies to the following methods on
118+ all models:
119+ - create
120+ - updateAttributes
121+
122+ Type: array
123+ Default: null
124+
125+ ### hideIrrelevantMethods
126+ By default, loopback-component-jsonapi disables a number of methods from each endpoint
127+ that are not jsonapi relevant. These methods are:
128+ - upsert
129+ - exists
130+ - findOne
131+ - count
132+ - createChangeStream
133+ - updateAll
134+ You can use this option to reenable these methods.
135+ Please note, these methods will not be modified by the component and so their output
136+ will not be in a jsonapi compliant format.
137+ Type: boolean
138+ Default: true
139+
90140## Debugging
91141You can enable debug logging by setting an environment variable:
92142DEBUG=loopback-component-jsonapi
0 commit comments