allow to hide all kinds of schema

pull/2708/head
Jan Sandbrink 10 years ago
parent bf419f482b
commit 95352fdf2a
  1. 12
      lib/api/decorators/schema.rb

@ -66,7 +66,8 @@ module API
name_source: property, name_source: property,
href_callback:, href_callback:,
required: true, required: true,
writable: true) writable: true,
show_if: true)
raise ArgumentError if property.nil? raise ArgumentError if property.nil?
property property, property property,
@ -83,7 +84,8 @@ module API
end end
representer representer
} },
if: show_if
end end
def schema_with_allowed_collection(property, def schema_with_allowed_collection(property,
@ -93,7 +95,8 @@ module API
value_representer:, value_representer:,
link_factory:, link_factory:,
required: true, required: true,
writable: true) writable: true,
show_if: true)
raise ArgumentError unless property raise ArgumentError unless property
property property, property property,
@ -113,7 +116,8 @@ module API
end end
representer representer
} },
if: show_if
end end
def represented_class def represented_class

Loading…
Cancel
Save