@vayo-hq/schema-engine
v0.1.1-beta.3
Published
Framework-agnostic schema inference/merge (genson-js) and the pure override-resolution function. No Express, no MongoDB.
Readme
@vayo-hq/schema-engine
Framework-agnostic schema inference and merge logic for Vayo — no Express import, no MongoDB import, pure functions only.
This is where a captured request/response sample and a static-scan result
get folded into one EndpointDoc, and where manual overrides get
re-applied on top at read time — never written back destructively, so a
re-scan or new traffic can never silently erase a manual edit. Key exports:
mergeCapturedSample(existing, sample)— fold one observed request/response into an endpoint's inferred schema.mergeStaticResult(existing, route, version)— fold in@vayo-hq/ast's static scan result.resolveEndpoint(endpoint, overrides)— applyvayo_overrideson top of a storedEndpointDoc, non-destructively.resolveVersion,stableHash,resolveAuthRequired,detectSchemaChange.
Consumed internally by @vayo-hq/db-mongo
(which calls these merge functions on every capture/scan) — most people
won't import this directly. Start with
@vayo-hq/cli.
License
MIT
