lib/mkit/app/controllers/services_controller.rb in mkit-0.8.0 vs lib/mkit/app/controllers/services_controller.rb in mkit-0.9.0

- old
+ new

@@ -25,11 +25,13 @@ end end get '/services/:id' do srv = find_by_id_or_name - resp = if request.env['CONTENT_TYPE'] == 'application/json' - srv.to_json + resp = if params[:format] == 'yaml' + srv.to_h({details: params[:details] == 'true'}).to_yaml + elsif params[:format] == 'json' + JSON.pretty_generate(srv.to_h({details: params[:details] == 'true'})) else format_response(srv) end resp end