Class JsonSchemaSample

java.lang.Object
ai.mindconnect.adminui.service.JsonSchemaSample

public final class JsonSchemaSample extends Object
Generates an example JSON payload from a JSON-Schema Map (the shape returned by Tool.parametersSchema()). Used to pre-fill the tool-test arguments box with a skeleton the admin can edit, instead of an empty {}.

Best-effort and intentionally simple: it walks properties, picking a placeholder per declared type (enum → first option, string → "", number → 0, boolean → false, array → [example], object → nested skeleton). Unknown/Untyped fields become null.

  • Method Details

    • example

      public static String example(Map<String,Object> schema)
      Returns a pretty-printed example JSON object for schema, or "{}\n" when the schema is null/empty or has no properties.