diff --git a/lib/schemable/response_schema_generator.rb b/lib/schemable/response_schema_generator.rb index 312206f..b29c5c0 100644 --- a/lib/schemable/response_schema_generator.rb +++ b/lib/schemable/response_schema_generator.rb @@ -31,10 +31,10 @@ module Schemable @schema_modifier.add_properties(schema, included_schema, '.') end - @schema_modifier.add_properties(schema, meta, '.') if collection - @schema_modifier.add_properties(schema, jsonapi, '.') + @schema_modifier.add_properties(schema, { meta: }, '.') if collection + @schema_modifier.add_properties(schema, { jsonapi: }, '.') - { type: :object, properties: schema } + { type: :object, properties: schema }.compact_blank end def meta