How to get associated values using JaSerializer json-api

Please help me
using generic json i have done giving output of a User and its tags this is the code

  def render("user.json", %{user: user}) do
        tags:, &tag_to_json(&1))}

  defp tag_to_json(tag) do
%{name:,subtype: tag.subtype, maintype: tag.maintype

now i transfer it to being a json-api
ive already got the main values this is the code

attributes [:name, :country]

how will i get , tag.subtype,tag.maintype?

i already tried attributes [:name, :country, :tags]

but it just returned

Thank you very much!