diff --git a/api/product.rb b/api/product.rb index cc3fa323adc0..4d51f07421bb 100644 --- a/api/product.rb +++ b/api/product.rb @@ -35,6 +35,7 @@ def api_name end def to_s + # relies on the custom to_json definitions JSON.pretty_generate(self) end diff --git a/api/type.rb b/api/type.rb index 85b4987457b9..0148d78bd1fa 100644 --- a/api/type.rb +++ b/api/type.rb @@ -74,6 +74,10 @@ def validate check_conflicts end + def to_s + JSON.pretty_generate(self) + end + def to_json(opts = nil) # ignore fields that will contain references to parent resources and # those which will be added later