JSON Schema

2020-12

Validate any opensdk.yaml or opensdk.json file against the published schema before building generator support or submitting to a registry.

Schema URL: https://opensdks.org/schema/v1/opensdk.schema.json

Validation

How to validate

CLI — ajv-cli
# Install ajv-cli
npm install -g ajv-cli ajv-formats

# Validate your opensdk.yaml
ajv validate \
  -s https://opensdks.org/schema/v1/opensdk.schema.json \
  -d ./opensdk.yaml \
  --spec=draft2020
Go
import "github.com/santhosh-tekuri/jsonschema/v5"

compiler := jsonschema.NewCompiler()
schema, _ := compiler.Compile(
  "https://opensdks.org/schema/v1/opensdk.schema.json",
)

var v interface{}
yaml.Unmarshal(data, &v)
err := schema.Validate(v)
Python
import jsonschema, yaml, urllib.request

url = "https://opensdks.org/schema/v1/opensdk.schema.json"
schema = json.load(urllib.request.urlopen(url))

with open("opensdk.yaml") as f:
    doc = yaml.safe_load(f)

jsonschema.validate(doc, schema)

Editor Integration

VS Code / YAML LSP

Add schema association to get inline validation and autocomplete in any YAML-LSP-capable editor.

.vscode/settings.json
{
  "yaml.schemas": {
    "https://opensdks.org/schema/v1/opensdk.schema.json": [
      "**/opensdk.yaml",
      "**/opensdk.json"
    ]
  }
}
opensdk.yaml — inline $schema reference
# Add this as the first line of any opensdk.yaml for editor support
# yaml-language-server: $schema=https://opensdks.org/schema/v1/opensdk.schema.json

opensdk: "1.0.0"
# ...

Schema Structure

Top-level definitions

LanguageTarget

Configuration for a single codegen target. Contains package, style, features, templates, and operationOverrides.

PackageConfig

Package name, version, module path, and registry target for the generated SDK in a given language ecosystem.

StyleConfig

Naming conventions, enum representations, optional field styles, date handling, and file naming conventions.

FeatureConfig

Auth helpers, retry behavior, pagination strategy, reconciliation mode, streaming, webhooks, mocking, and telemetry.

TemplateConfig

Base template URL, template engine, and per-operation or per-model template overrides.

CodegenRules

Cross-language validation gates, reconciliation settings, breaking change policy, output structure, and global field exclusions.

opensdk.schema.json

JSON Schema 2020-12 · Apache-2.0

Download Schema View on GitHub ↗