@@ -164,13 +164,8 @@ properties. This is the default configuration in effect if you don't specify an
164
164
value :
165
165
strategy : scalars
166
166
fields :
167
- href :
168
- enabled : false
169
167
customData :
170
168
strategy : scalars
171
- fields :
172
- href :
173
- enabled : false
174
169
groups :
175
170
strategy : defined
176
171
elements :
@@ -188,23 +183,18 @@ So what does this mean? You can summarize this in English as the following:
188
183
189
184
- all of the account's `scalar `_ (i.e. non object/collection) fields to be included, each as a JSON name/value pair.
190
185
191
- - However, I want specific overriding rules for the ``href ``, ``customData `` and ``groups `` fields. For these:
192
-
193
- - don't include the account's ``href `` field. My origin server(s) behind the gateway probably won't talk
194
- directly with Stormpath and won't know what to do with that url, so exclude it
186
+ - However, I want specific overriding rules for the ``customData `` and ``groups `` fields. For these:
195
187
196
188
- ``customData `` isn't a scalar, but I want it included anyway, so I'm going to define conversion rules for it
197
- too. Those are :
189
+ too. That is :
198
190
199
191
- Include any of the customData's scalar properties automatically
200
192
201
- - However, don't include the customData's ``href ``, since my origin server(s) won't know what to do with it.
202
-
203
193
- ``groups `` isn't a scalar (it's a ``GroupsCollection `` object), but I want it included anyway.
204
194
205
195
- However, in this case I want to include *only * fields that are explicitly *defined * in its ``fields ``
206
196
list. (In this case, even though the strategy is ``defined ``, no actual ``fields `` have been specified.
207
- This means that *no * fields on the ``GroupsCollection `` object itself, like 'size' and 'limit' will be
197
+ This means that *no * fields on the ``GroupsCollection `` object itself, like 'href', ' size' and 'limit' will be
208
198
included. We just want the collection's elements, described next.)
209
199
210
200
- The collection ``elements `` are enabled so I do want the elements in the collection.
@@ -221,6 +211,7 @@ bytes transmitted over the network, the actual value won't be pretty-printed):
221
211
.. code-block :: json
222
212
223
213
{
214
+ "href" : " https://api.stormpath.com/v1/accounts/753veZGE2aIy64VnTrF5Ov" ,
224
215
"username" : " tk421" ,
225
216
226
217
"givenName" : " TK421" ,
@@ -233,20 +224,23 @@ bytes transmitted over the network, the actual value won't be pretty-printed):
233
224
"passwordModifiedAt" : " 2016-12-15T19:58:55.000Z" ,
234
225
"emailVerificationToken" : null ,
235
226
"customData" : {
227
+ "href" : " https://api.stormpath.com/v1/accounts/753veZGE2aIy64VnTrF5Ov/customData" ,
236
228
"createdAt" : " 2016-12-15T19:58:55.272Z" ,
237
229
"modifiedAt" :" 2016-12-15T19:59:23.729Z" ,
238
230
"favoriteColor" : " Blaster Black"
239
231
},
240
232
"groups" : {
241
233
"items" : [
242
234
{
235
+ "href" : " https://api.stormpath.com/v1/groups/4NQzRKj0qDq1wIg9M0jUfa" ,
243
236
"name" : " dsguards" ,
244
237
"description" : " Death Star Guards" ,
245
238
"status" : " ENABLED" ,
246
239
"createdAt" : " 2016-12-28T00:34:46.453Z" ,
247
240
"modifiedAt" :" 2016-12-28T00:34:46.453Z"
248
241
},
249
242
{
243
+ "href" : " https://api.stormpath.com/v1/groups/9fBEMQtvElx2Zn7a0ku1Dj" ,
250
244
"name" : " troopers" ,
251
245
"description" : " All stormtroopers" ,
252
246
"status" : " ENABLED" ,
@@ -398,6 +392,23 @@ The ``enabled`` conversion property indicates if the field will be included in t
398
392
the value is ``false ``, that field will not be included at all in the output sent to the origin server. The default
399
393
value is ``true ``.
400
394
395
+ For example, the following config indicates that, although the general strategy is to include the user account's
396
+ scalar fields, the ``href `` field is excluded/omitted from the output JSON entirely:
397
+
398
+ .. code-block :: yaml
399
+ :emphasize-lines : 8-9
400
+
401
+ stormpath :
402
+ zuul :
403
+ account :
404
+ header :
405
+ value :
406
+ strategy : scalars
407
+ fields :
408
+ href :
409
+ enabled : false
410
+
411
+
401
412
.. _object conversion field :
402
413
403
414
``field ``
0 commit comments