summaryrefslogtreecommitdiff
path: root/lib/chef_zero/endpoints/role_endpoint.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef_zero/endpoints/role_endpoint.rb')
-rw-r--r--lib/chef_zero/endpoints/role_endpoint.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef_zero/endpoints/role_endpoint.rb b/lib/chef_zero/endpoints/role_endpoint.rb
index 5b7a1b3..e4c4377 100644
--- a/lib/chef_zero/endpoints/role_endpoint.rb
+++ b/lib/chef_zero/endpoints/role_endpoint.rb
@@ -1,4 +1,4 @@
-require 'json'
+require 'ffi_yajl'
require 'chef_zero/endpoints/rest_object_endpoint'
require 'chef_zero/data_normalizer'
@@ -7,9 +7,9 @@ module ChefZero
# /roles/NAME
class RoleEndpoint < RestObjectEndpoint
def populate_defaults(request, response_json)
- role = JSON.parse(response_json, :create_additions => false)
+ role = FFI_Yajl::Parser.parse(response_json, :create_additions => false)
role = DataNormalizer.normalize_role(role, request.rest_path[3])
- JSON.pretty_generate(role)
+ FFI_Yajl::Encoder.encode(role, :pretty => true)
end
end
end