Excluding properties from responses

By default, properties are returned in endpoint responses for both collections (summary response) and single elements (detail response). You can change this behavior with the defaultViews property.

For more information on default and summary responses, see The fields query parameter

Important: The defaultViews property is for use only with custom properties. Guidewire does not recommend using this property to modify the behavior of base configuration properties.

Return a field only in detail responses

If you want a field to be returned by default in endpoint responses only in detail view but not in the collection summary, set the defaultViews property to detail:

"x-gw-extensions": {
 "defaultViews": [
   "detail"
 ]

Do not return a field in a response

There might be some fields that you never want returned in default responses, either for summary or detail responses. For example, fields requiring calculations could cause performance issues if they were always included in responses. You can define a field as not being returned by default by setting defaultViews to none:

"x-gw-extensions": {
 "defaultViews": [
   "none"
 ]

When you do this, there are only two ways to include the property in the response:

  • Specify the property explicitly with the fields query parameter.
  • Specify *all in the fields query parameter. (Not recommended for production environments.)