Skip to content
HALOWERK

Codewerk

openapi examples fill

Walks every media type of responses and request bodies, every parameter with a schema and, if requested, every component schema. Where neither example nor examples exist, a deterministic placeholder is built from the schema: const, default, examples or the first enum value first, then canonical values per type and format (documentation-reserved values: example.com per RFC 2606, 192.0.2.1 per RFC 5737, 2001:db8::1 per RFC 3849, the RFC 9562 sample UUID; dates in 2026), honouring.

POST https://code.halowerk.com/v1/openapi-examples-fill

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
specSee schemaYesThe OpenAPI 3.0/3.1 document as a JSON object or JSON/YAML string (max. 2 MB). External $ref values are rejected.
targetsarrayNoWhere to add examples.
include_optionalbooleanNoFill optional object properties too.
overwrite_invalidbooleanNoReplace existing examples that violate their schema.
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "spec"
  ],
  "properties": {
    "spec": {
      "description": "The OpenAPI 3.0/3.1 document as a JSON object or JSON/YAML string (max. 2 MB). External $ref values are rejected.",
      "anyOf": [
        {
          "type": "object"
        },
        {
          "type": "string",
          "minLength": 2,
          "maxLength": 2000000
        }
      ]
    },
    "targets": {
      "type": "array",
      "uniqueItems": true,
      "minItems": 1,
      "items": {
        "type": "string",
        "enum": [
          "responses",
          "request_bodies",
          "parameters",
          "schemas"
        ]
      },
      "default": [
        "responses",
        "request_bodies",
        "parameters"
      ],
      "description": "Where to add examples."
    },
    "include_optional": {
      "type": "boolean",
      "default": true,
      "description": "Fill optional object properties too."
    },
    "overwrite_invalid": {
      "type": "boolean",
      "default": false,
      "description": "Replace existing examples that violate their schema."
    }
  }
}

Open original schema

Published input example

{
  "spec": {
    "openapi": "3.0.3",
    "info": {
      "title": "Users",
      "version": "1"
    },
    "paths": {
      "/users": {
        "get": {
          "responses": {
            "200": {
              "description": "ok",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "required": [
                      "id",
                      "email"
                    ],
                    "properties": {
                      "id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "email": {
                        "type": "string",
                        "format": "email"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’