MCPcopy
hub / github.com/hashicorp/hcl / Content

Method Content

ext/dynblock/expand_body.go:35–50  ·  view source on GitHub ↗
(schema *hcl.BodySchema)

Source from the content-addressed store, hash-verified

33}
34
35func (b *expandBody) Content(schema *hcl.BodySchema) (*hcl.BodyContent, hcl.Diagnostics) {
36 extSchema := b.extendSchema(schema)
37 rawContent, diags := b.original.Content(extSchema)
38
39 blocks, blockDiags := b.expandBlocks(schema, rawContent.Blocks, false)
40 diags = append(diags, blockDiags...)
41 attrs := b.prepareAttributes(rawContent.Attributes)
42
43 content := &hcl.BodyContent{
44 Attributes: attrs,
45 Blocks: blocks,
46 MissingItemRange: b.original.MissingItemRange(),
47 }
48
49 return content, diags
50}
51
52func (b *expandBody) PartialContent(schema *hcl.BodySchema) (*hcl.BodyContent, hcl.Body, hcl.Diagnostics) {
53 extSchema := b.extendSchema(schema)

Callers

nothing calls this directly

Calls 5

extendSchemaMethod · 0.95
expandBlocksMethod · 0.95
prepareAttributesMethod · 0.95
ContentMethod · 0.65
MissingItemRangeMethod · 0.65

Tested by

no test coverage detected