annotation CrSerializer::Annotations::Expose

Overview

Indicates that a property should be serialized/deserialized when used with CrSerializer::ExclusionPolicy::All.

@[CRS::ExclusionPolicy(:all)]
class Example
  include CrSerializer

  def initialize; end

  @[CRS::Expose]
  property name : String = "Jim"

  property password : String? = "monkey"
end

Example.new.to_json # => {"name":"Jim"}

Defined in:

annotations.cr