Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Validate NDJSON

schema.validate_ndjson

ProductionEngine wrapper (Class A)Deterministicverifiablefastv1.0.0
File inputNo network

Overview

You send NDJSON text, or a reference to a file of it, and we read every non-blank line as its own JSON value. Anything that will not parse, or that turns out to be an array rather than a record, is reported with the line it sits on. Hand us a JSON Schema as well and we check every record against it in the 2020-12 dialect, so one bad row out of a hundred thousand is easy to find. Each record must be on a single line; a pretty-printed document spread over many lines is not NDJSON.

Logs, exports, and streaming APIs all speak NDJSON, and a whole-file parse tells you only that something somewhere is broken. Line-scoped checking tells you which record to fix.

Reliability

Deterministic: the same input and options always produce the same problems in the same order. Without a schema we only check that each line parses and is not an array, so a bare number or string on a line passes — supply a schema if records must be objects. A schema is always read as 2020-12, whatever its own $schema keyword says, and references within it resolve while nothing outside it is fetched for you. We reject the call, and an unchanged retry will not help, when neither content nor fileRef is present, when maxRecords or maxErrors falls outside its range, when the file holds more than maxRecords records, when schema is not an object or cannot be compiled, or when a referenced file is missing, unreadable, or over 20000000 bytes.

Context footprint

Inline text is capped at 2097152 characters and a referenced file at 20000000 bytes; the response holds at most maxErrors short rows, so a badly broken file cannot flood your context. A successful call costs 1 execution credit.

When to use it

When you have newline-delimited records to check before ingesting or replaying them, with or without a schema to hold them to.

When the payload is one pretty-printed document, or when you want the records repaired rather than reported.

Powered by the networknt JSON Schema validator, a fast, spec-compliant engine for Draft 4 through 2020-12.

Scope

Note
We check each line of an NDJSON file as its own JSON record, optionally against a schema, and report every problem with its line number.

Non-goals

  • We never repair or rewrite a record — that is schema.repair_json
  • We never pull in another document, so send a self-contained schema
  • We never treat a multi-line document as one value; that is schema.validate_json

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

validation

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input2 MBMax file size19.1 MB

File limits

Constraints this skill applies to your input and generated files. The “Limited by” column shows the static source of each cap; none of these can be raised by upgrading your plan.

LimitValueLimited by
Maximum size per input file19.1 MiBSkill and platform maximum

How we handle your data

Sensitive input, safe output
What this means

This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.

Squillify guarantees
  • Runs inside Squillify
  • This skill runs inside Squillify.
  • Payloads are not sent to an external service by this skill.
  • Squillify does not permanently store submitted payloads.
  • Telemetry records metadata only, not submitted content.
  • Submitted payloads are not used for training.
  • Submitted payloads are not reviewed by humans.
  • This skill does not target sensitive data.
  • The response does not contain submitted content.
Your responsibility

Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
contentstringNoNDJSON text, one record per line, 1 to 2097152 characters. Required unless fileRef is provided.
fileRefstringNoTenant-owned NDJSON file reference; omit it to read content. When both are sent this one wins.
schemaobjectNoJSON Schema applied to every record in the 2020-12 dialect; omit it for a structural parse-only pass. — unconstrained RFC 8259 JSON items.
allowBlankLinesbooleanNoWhether empty lines between records are acceptable; omit it for false.
maxRecordsintegerNoMost records to accept, 1 through 1000000; omit it for 1000000. Going past it rejects the call.
maxErrorsintegerNoHow many problems to list, 1 through 100000; omit it for 500.

Output schema

FieldTypeRequiredDescription
validbooleanYesTrue when no problems were recorded.
recordCountintegerYesHow many non-blank lines were treated as records.
errorCountintegerYesHow many problems are in the errors list after the cap.
errorsarrayYesProblems in file order, 0 through 100000 closed {line, code, message} objects.
schemaValidatedbooleanYesTrue when a schema was supplied and every record was checked against it.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"schema.validate_ndjson","input":{"content":"{\"id\":1}\n{\"id\":2}\n"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("schema.validate_ndjson", {"content":"{\"id\":1}\n{\"id\":2}\n"});

Errors

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • We never repair or rewrite a record — that is schema.repair_json
  • We never pull in another document, so send a self-contained schema
  • We never treat a multi-line document as one value; that is schema.validate_json
  • A single pretty-printed JSON document (schema.validate_json)
  • Records that legitimately span several lines

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "schema.validate_ndjson",
  "input": {
    "content": "{\"id\":1}\n{\"id\":2}\n"
  }
}

Examples

Two valid NDJSON records

Inputjson
{
  "content": "{\"id\":1}\n{\"id\":2}\n"
}
Expected outputjson
{
  "errorCount": 0,
  "valid": true,
  "recordCount": 2,
  "errors": [],
  "schemaValidated": false
}

Malformed line reported with line number

Inputjson
{
  "content": "{\"id\":1}\nnot-json\n"
}
Expected outputjson
{
  "errorCount": 1,
  "valid": false,
  "recordCount": 2,
  "errors": [
    {
      "code": "PARSE_ERROR",
      "line": 2,
      "message": "Invalid JSON on line."
    }
  ],
  "schemaValidated": false
}
  • Check a log or export file before you load it anywhere
  • Preflight a streaming payload one record at a time
  • Find the handful of bad rows in a large generated file

Avoid for

  • A single pretty-printed JSON document (schema.validate_json)
  • Records that legitimately span several lines

Composable with

Safety & privacy

  • Runs without calling any external service.
  • Your payloads are never stored permanently.
  • Telemetry captures metadata only — never your payload contents.
  • We never train models on your payloads.
  • No human reviews your payloads.

Tags

schemajsonvalidation