MCPcopy Index your code
hub / github.com/SchemaStore/schemastore / assertTopLevelRefIsStandalone

Function assertTopLevelRefIsStandalone

cli.js:1879–1889  ·  view source on GitHub ↗
(/** @type {SchemaFile} */ schema)

Source from the content-addressed store, hash-verified

1877}
1878
1879async function assertTopLevelRefIsStandalone(/** @type {SchemaFile} */ schema) {
1880 if (schema.json.$ref?.startsWith('http')) {
1881 for (const [member] of Object.entries(schema.json)) {
1882 if (member !== '$ref') {
1883 printErrorAndExit(new Error(), [
1884 `Schemas that reference a remote schema must only have $ref as a property. Found property "${member}" for "${schema.name}"`,
1885 ])
1886 }
1887 }
1888 }
1889}
1890
1891async function printSchemaReport() {
1892 // `bowtie validate --implementation go-gojsonschema ./src/schemas/json/ava.json ./src/test/ava/ava.config.json`

Callers 1

onSchemaFileFunction · 0.85

Calls 1

printErrorAndExitFunction · 0.85

Tested by

no test coverage detected