Special attribute not appearing in AshJsonApi


I have the following attributes defined in a resource

attributes do
    uuid_primary_key :id

    attribute :component, :string do
      allow_nil? false

    attribute :uid_hash, :string

    create_timestamp :created_at

Note the created_at special attribute.

I am unable to select, filter or sort by created_at.

Any solutions/workaround?

Best regards

create_timestamp sets a couple of default options on the attribute, one of them is private? true DSL: Ash.Resource.Dsl — ash v2.21.2

To make the attribute visible just set the option yourself

create_timestamp :created_at, private?: false

1 Like