@intentius/chant-lexicon-aws 0.124.101 → 0.124.103

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.
@@ -17,6 +17,8 @@ export interface LexiconEntry {
17
17
  createOnly?: string[];
18
18
  writeOnly?: string[];
19
19
  primaryIdentifier?: string[];
20
+ /** The schema's top-level `required` properties, sorted (#4524: `chant import --index` names those a listing left out). */
21
+ required?: string[];
20
22
  deprecatedProperties?: string[];
21
23
  /**
22
24
  * Subset of `deprecatedProperties` that only a regex over the property
@@ -5,6 +5,12 @@
5
5
  */
6
6
  import { cfnShortName } from "../spec/parse.js";
7
7
  import { buildRegistry, serializeRegistry, } from "@intentius/chant/codegen/generate-registry";
8
+ function requiredOf(r) {
9
+ return r.resource.properties
10
+ .filter((p) => p.required)
11
+ .map((p) => p.name)
12
+ .sort();
13
+ }
8
14
  /**
9
15
  * Generate the lexicon-aws.json content.
10
16
  */
@@ -36,6 +42,7 @@ export function generateLexiconJSON(results, naming, constraints, runtimeDepreca
36
42
  ...(r.resource.createOnly.length > 0 && { createOnly: r.resource.createOnly }),
37
43
  ...(r.resource.writeOnly.length > 0 && { writeOnly: r.resource.writeOnly }),
38
44
  ...(r.resource.primaryIdentifier.length > 0 && { primaryIdentifier: r.resource.primaryIdentifier }),
45
+ ...(requiredOf(r).length > 0 && { required: requiredOf(r) }),
39
46
  ...(r.resource.deprecatedProperties?.length && { deprecatedProperties: r.resource.deprecatedProperties }),
40
47
  ...(r.resource.inferredDeprecations?.length && { inferredDeprecations: r.resource.inferredDeprecations }),
41
48
  ...(r.resource.conditionalCreateOnly?.length && { conditionalCreateOnly: r.resource.conditionalCreateOnly }),