Skip to content

Data Examples

github-actions[bot] edited this page Mar 10, 2026 · 1 revision

Lexion Data Examples

This page shows practical examples of data returned by Lexion APIs.

@lexion-rte/core - editor.getJSON()

{
  "type": "doc",
  "content": [
    {
      "type": "paragraph",
      "content": [
        { "type": "text", "text": "Hello " },
        { "type": "text", "marks": [{ "type": "strong" }], "text": "Lexion" }
      ]
    },
    {
      "type": "heading",
      "attrs": { "level": 2 },
      "content": [{ "type": "text", "text": "Section title" }]
    },
    {
      "type": "bullet_list",
      "content": [
        {
          "type": "list_item",
          "content": [
            {
              "type": "paragraph",
              "content": [{ "type": "text", "text": "First item" }]
            }
          ]
        }
      ]
    }
  ]
}

Adapters (web/react/vue/vue2) - Change Callback Value

onChange / update:modelValue returns the same JSONDocument shape used by core.

{
  "type": "doc",
  "content": [
    {
      "type": "paragraph",
      "content": [{ "type": "text", "text": "Current editor value" }]
    }
  ]
}

@lexion-rte/tools

toHTML(editor)

<p>Hello <strong>Lexion</strong></p><h2>Section title</h2>

toText(editor)

Hello Lexion

Section title

apps/api Response Examples

POST /documents/from-text

{
  "document": {
    "type": "doc",
    "content": [
      {
        "type": "paragraph",
        "content": [{ "type": "text", "text": "Imported text value" }]
      }
    ]
  }
}

POST /documents/to-text

{
  "text": "Imported text value"
}

POST /commands/execute

{
  "executed": true,
  "document": {
    "type": "doc",
    "content": [
      {
        "type": "paragraph",
        "content": [{ "type": "text", "text": "Updated value after command" }]
      }
    ]
  }
}

Commercial Data Flows

Commercial collaboration and AI payload shapes are intentionally omitted from the public repository documentation.

The public repo documents only community package inputs and outputs.

Clone this wiki locally