Skip to content

Support _comment fields in state machine JSON for documentation #37

@ottobot-ai

Description

@ottobot-ai

Problem

The SDK state machines include _comment fields for documentation purposes:

{
  "states": {
    "Idle": {
      "_comment": "Initial state before market opens"
    }
  }
}

However, OttoChain's Circe decoders reject unknown fields, causing validation errors.

Options

  1. Ignore unknown fields — Update Circe decoder config with .withDefaults + filter unknown keys
  2. Explicit support — Add optional _comment: Option[String] to State/Transition case classes
  3. Keep SDK clean — Remove all _comment fields from SDK (current workaround)

Current Status

PR #47 removed _comment fields as a workaround. This issue tracks adding proper support.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions