Marks is undefined when serializing a fragment

Hi all, I am trying to render a doc as html.

This is what I am doing:

DOMSerializer.fromSchema(editorSchema).serializeFragment(content);

Where content is

[
  {
    "type": "paragraph",
    "content": [
      {
        "type": "text",
        "text": "hello elixir "
      },
      {
        "type": "text",
        "marks": [
          {
            "type": "strong"
          }
        ],
        "text": "and"
      },
      {
        "type": "text",
        "text": " erlang!"
      }
    ]
  }
]

I am getting

Uncaught TypeError: a.marks is undefined

marks is present in the schema

What am I doing wrong? Thank you

Cheers!

If you’re giving that method raw JSON, instead of a deserialized objects, then that’s the problem.

Indeed that was it. Thank you!

Cheers