diff --git a/features/combined_json.feature b/features/combined_json.feature index 94da4f48..3e8b2662 100644 --- a/features/combined_json.feature +++ b/features/combined_json.feature @@ -68,6 +68,8 @@ Feature: Combined text [ { "resource": "Greetings", + "http_method": "GET", + "route": "/greetings", "description": "Greeting your favorite gem", "explanation": null, "parameters": [ @@ -103,6 +105,8 @@ Feature: Combined text }, { "resource": "Greetings", + "http_method": "GET", + "route": "/greetings", "description": "Greeting your favorite developers of your favorite gem", "explanation": null, "parameters": [ diff --git a/lib/rspec_api_documentation/json_writer.rb b/lib/rspec_api_documentation/json_writer.rb index ffa3fe3e..10c395cb 100644 --- a/lib/rspec_api_documentation/json_writer.rb +++ b/lib/rspec_api_documentation/json_writer.rb @@ -81,14 +81,20 @@ def filename "#{basename}.json" end - def to_json + def as_json { :resource => resource_name, + :http_method => http_method, + :route => route, :description => description, :explanation => explanation, :parameters => respond_to?(:parameters) ? parameters : [], :requests => requests - }.to_json + } + end + + def to_json + as_json.to_json end def requests