@formspec/build 0.1.0-alpha.41 → 0.1.0-alpha.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.cjs +79 -6
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.js +79 -6
- package/dist/browser.js.map +1 -1
- package/dist/cli.cjs +80 -6
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +80 -6
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +79 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +79 -6
- package/dist/index.js.map +1 -1
- package/dist/internals.cjs +79 -6
- package/dist/internals.cjs.map +1 -1
- package/dist/internals.js +79 -6
- package/dist/internals.js.map +1 -1
- package/package.json +4 -4
package/dist/cli.js
CHANGED
|
@@ -1600,12 +1600,25 @@ function applyCustomConstraint(schema, constraint, ctx) {
|
|
|
1600
1600
|
`Cannot generate JSON Schema for custom constraint "${constraint.constraintId}" without a matching extension registration`
|
|
1601
1601
|
);
|
|
1602
1602
|
}
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1603
|
+
const extensionSchema = registration.toJsonSchema(constraint.payload, ctx.vendorPrefix);
|
|
1604
|
+
if (registration.emitsVocabularyKeywords) {
|
|
1605
|
+
const target = schema;
|
|
1606
|
+
for (const [key, value] of Object.entries(extensionSchema)) {
|
|
1607
|
+
if (JSON_SCHEMA_STRUCTURAL_KEYWORDS.has(key)) {
|
|
1608
|
+
throw new Error(
|
|
1609
|
+
`Custom constraint "${constraint.constraintId}" with emitsVocabularyKeywords must not overwrite standard JSON Schema keyword "${key}"`
|
|
1610
|
+
);
|
|
1611
|
+
}
|
|
1612
|
+
target[key] = value;
|
|
1613
|
+
}
|
|
1614
|
+
} else {
|
|
1615
|
+
assignVendorPrefixedExtensionKeywords(
|
|
1616
|
+
schema,
|
|
1617
|
+
extensionSchema,
|
|
1618
|
+
ctx.vendorPrefix,
|
|
1619
|
+
`custom constraint "${constraint.constraintId}"`
|
|
1620
|
+
);
|
|
1621
|
+
}
|
|
1609
1622
|
}
|
|
1610
1623
|
function applyCustomAnnotation(schema, annotation, ctx) {
|
|
1611
1624
|
const registration = ctx.extensionRegistry?.findAnnotation(annotation.annotationId);
|
|
@@ -1634,11 +1647,72 @@ function assignVendorPrefixedExtensionKeywords(schema, extensionSchema, vendorPr
|
|
|
1634
1647
|
schema[key] = value;
|
|
1635
1648
|
}
|
|
1636
1649
|
}
|
|
1650
|
+
var JSON_SCHEMA_STRUCTURAL_KEYWORDS;
|
|
1637
1651
|
var init_ir_generator = __esm({
|
|
1638
1652
|
"src/json-schema/ir-generator.ts"() {
|
|
1639
1653
|
"use strict";
|
|
1640
1654
|
init_metadata();
|
|
1641
1655
|
init_collision_guards();
|
|
1656
|
+
JSON_SCHEMA_STRUCTURAL_KEYWORDS = /* @__PURE__ */ new Set([
|
|
1657
|
+
"$schema",
|
|
1658
|
+
"$ref",
|
|
1659
|
+
"$defs",
|
|
1660
|
+
"$id",
|
|
1661
|
+
"$anchor",
|
|
1662
|
+
"$dynamicRef",
|
|
1663
|
+
"$dynamicAnchor",
|
|
1664
|
+
"$vocabulary",
|
|
1665
|
+
"$comment",
|
|
1666
|
+
"type",
|
|
1667
|
+
"enum",
|
|
1668
|
+
"const",
|
|
1669
|
+
"properties",
|
|
1670
|
+
"patternProperties",
|
|
1671
|
+
"additionalProperties",
|
|
1672
|
+
"required",
|
|
1673
|
+
"items",
|
|
1674
|
+
"prefixItems",
|
|
1675
|
+
"additionalItems",
|
|
1676
|
+
"contains",
|
|
1677
|
+
"allOf",
|
|
1678
|
+
"oneOf",
|
|
1679
|
+
"anyOf",
|
|
1680
|
+
"not",
|
|
1681
|
+
"if",
|
|
1682
|
+
"then",
|
|
1683
|
+
"else",
|
|
1684
|
+
"minimum",
|
|
1685
|
+
"maximum",
|
|
1686
|
+
"exclusiveMinimum",
|
|
1687
|
+
"exclusiveMaximum",
|
|
1688
|
+
"multipleOf",
|
|
1689
|
+
"minLength",
|
|
1690
|
+
"maxLength",
|
|
1691
|
+
"pattern",
|
|
1692
|
+
"minItems",
|
|
1693
|
+
"maxItems",
|
|
1694
|
+
"uniqueItems",
|
|
1695
|
+
"minProperties",
|
|
1696
|
+
"maxProperties",
|
|
1697
|
+
"minContains",
|
|
1698
|
+
"maxContains",
|
|
1699
|
+
"format",
|
|
1700
|
+
"title",
|
|
1701
|
+
"description",
|
|
1702
|
+
"default",
|
|
1703
|
+
"deprecated",
|
|
1704
|
+
"readOnly",
|
|
1705
|
+
"writeOnly",
|
|
1706
|
+
"examples",
|
|
1707
|
+
"dependentRequired",
|
|
1708
|
+
"dependentSchemas",
|
|
1709
|
+
"propertyNames",
|
|
1710
|
+
"unevaluatedItems",
|
|
1711
|
+
"unevaluatedProperties",
|
|
1712
|
+
"contentEncoding",
|
|
1713
|
+
"contentMediaType",
|
|
1714
|
+
"contentSchema"
|
|
1715
|
+
]);
|
|
1642
1716
|
}
|
|
1643
1717
|
});
|
|
1644
1718
|
|