Skip to main content

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

MicroSkills Reference

Generate Test Cases from Schema

quality.generate_test_cases_from_schema

ProductionBounded custom (Class B)Deterministicstrictmoderatev1.0.0
No network

Overview

You send a JSON Schema and we build a payload that satisfies it, then a set of near-misses that each break one rule — a required property removed, a number pushed past its bound, a string made too long, the wrong type entirely. Every case is run through the same validator the platform uses before it reaches you, so a case labelled invalid really does fail and one labelled valid really does pass; anything we cannot confirm is dropped with a note rather than guessed at. The answer also tells you which keywords in your schema we could target and which we could not.

Writing the failing half of a test suite by hand is tedious and easy to get subtly wrong — a case meant to fail that quietly passes teaches you nothing.

Reliability

The same schema and the same options always give the same cases, in the same order, and nothing leaves the platform — a $ref that points at an address is refused rather than fetched. Two limits are worth planning around. Failing cases are built from the top level of your schema, so a constraint on a nested property shapes the passing payload but does not get a case of its own; coverage tells you which keywords were actually targeted. And pattern, oneOf, anyOf, allOf, not, if, then, and else are listed as unsupported rather than quietly skipped, so a schema built mostly from those yields few cases. Every case is checked against the real validator first, and one that does not behave as intended is dropped with a warning instead of shipped. Two failures stop the call, both needing a change from you rather than a retry: INVALID_JSON_SCHEMA means the schema will not compile, or the draft you named is not one we support, so the message points at the problem; REMOTE_REF_FORBIDDEN means a $ref starts with http, https, or a double slash, so inline that definition or move it into the same document.

Context footprint

Every case carries its whole payload, so the reply grows with maxCases and with how large one instance of your schema is; lower maxCases, or turn off the half you do not need, to keep it small. A successful call costs 1 execution credit.

When to use it

When a schema exists and you want a starting set of cases you can trust.

When you need full coverage guaranteed, or data that looks like real data.

Runs on the networknt JSON Schema validator, the same one the platform validates with, so a verdict here matches a verdict there.

Scope

Note
We build passing and failing payloads from your schema and verify each one.

Non-goals

  • Does not claim the cases cover your schema exhaustively
  • Does not fetch a $ref that points at an address
  • Does not build cases for pattern or the combinator keywords
  • Does not invent lifelike sample data — the payloads are minimal on purpose

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

generationvalidation

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input976.6 KB

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
schemaobjectYesJSON Schema to generate cases from; extra keys are schema keywords and nested $ref must stay inside this document. — unconstrained RFC 8259 JSON items.
optionsobjectNoClosed generation controls; omit the object to include valid and invalid cases, cap at 100, use draft 2020-12, seed 42 and the boundaries strategy.

Output schema

FieldTypeRequiredDescription
casesarrayYesGenerated cases in target-path then id order, 0 through 200 closed objects.
coverageobjectYesClosed coverage report with alphabetically sorted keywordsSeen, keywordsTargeted and keywordsUnsupported arrays.
warningsarrayYesNon-fatal advisory notices as 0 through 100 strings, each one sentence long; empty when nothing was worth flagging.
_metaobjectYesClosed bookkeeping echoing seed and strategy plus the generatorProfile that produced these cases.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"quality.generate_test_cases_from_schema","input":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

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

const { output } = await sq.execute("quality.generate_test_cases_from_schema", {"schema":{"properties":{"name":{"type":"string"}},"type":"object","required":["name"]}});

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.
INVALID_JSON_SCHEMA400NoThe request payload failed this skill's input validation.
REMOTE_REF_FORBIDDEN422NoThe input was rejected as unsafe.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not claim the cases cover your schema exhaustively
  • Does not fetch a $ref that points at an address
  • Does not build cases for pattern or the combinator keywords
  • Does not invent lifelike sample data — the payloads are minimal on purpose
  • Proving a schema is fully covered
  • Producing realistic-looking data for a demo or a fixture

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "quality.generate_test_cases_from_schema",
  "input": {
    "schema": {
      "properties": {
        "name": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "name"
      ]
    }
  }
}

Examples

A small object schema, with the cases it earns

Inputjson
{
  "schema": {
    "properties": {
      "name": {
        "type": "string"
      }
    },
    "type": "object",
    "required": [
      "name"
    ]
  }
}
Expected outputjson
{
  "_meta": {
    "seed": 42,
    "generatorProfile": "json-schema-cases-1",
    "strategy": "boundaries"
  },
  "warnings": [],
  "coverage": {
    "keywordsTargeted": [
      "required",
      "type"
    ],
    "keywordsUnsupported": [],
    "keywordsSeen": [
      "properties",
      "required",
      "type"
    ]
  },
  "cases": [
    {
      "id": "valid_baseline",
      "classification": "valid",
      "targetKeyword": null,
      "targetPath": "",
      "instance": {
        "name": "a"
      },
      "expected": {
        "valid": true,
        "errorKeywords": [],
        "instancePath": ""
      }
    },
    {
      "id": "invalid_missing_required__name",
      "classification": "invalid",
      "targetKeyword": "required",
      "targetPath": "/required",
      "instance": {},
      "expected": {
        "valid": false,
        "errorKeywords": [
          "required"
        ],
        "instancePath": ""
      }
    },
    {
      "id": "invalid_type",
      "classification": "invalid",
      "targetKeyword": "type",
      "targetPath": "/type",
      "instance": "not_object",
      "expected": {
        "valid": false,
        "errorKeywords": [
          "type"
        ],
        "instancePath": ""
      }
    }
  ]
}

Keeping only the failing cases, capped at five

Inputjson
{
  "options": {
    "maxCases": 5,
    "includeValid": false
  },
  "schema": {
    "properties": {
      "name": {
        "type": "string"
      }
    },
    "type": "object",
    "required": [
      "name"
    ]
  }
}
Expected outputjson
{
  "_meta": {
    "seed": 42,
    "generatorProfile": "json-schema-cases-1",
    "strategy": "boundaries"
  },
  "warnings": [],
  "coverage": {
    "keywordsTargeted": [
      "required",
      "type"
    ],
    "keywordsUnsupported": [],
    "keywordsSeen": [
      "properties",
      "required",
      "type"
    ]
  },
  "cases": [
    {
      "id": "invalid_missing_required__name",
      "classification": "invalid",
      "targetKeyword": "required",
      "targetPath": "/required",
      "instance": {},
      "expected": {
        "valid": false,
        "errorKeywords": [
          "required"
        ],
        "instancePath": ""
      }
    },
    {
      "id": "invalid_type",
      "classification": "invalid",
      "targetKeyword": "type",
      "targetPath": "/type",
      "instance": "not_object",
      "expected": {
        "valid": false,
        "errorKeywords": [
          "type"
        ],
        "instancePath": ""
      }
    }
  ]
}
  • Start a contract test suite from a schema you already publish
  • Get the boundary cases nobody remembers to write by hand
  • Check that your own validator agrees about what should fail

Avoid for

  • Proving a schema is fully covered
  • Producing realistic-looking data for a demo or a fixture

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

qualityjsonvalidation