[schema] Add enum overlay support. (#8425)
And update the metaschema to accommodate the `isOverlay` properties added in #8338. Overlay enums, like other overlay members, are implemented out-of-band by the declaring package. Code generators should not generate declarations for overlay enums.
This commit is contained in:
parent
ed769377dc
commit
a1339277f0
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
- [schema] Add IsOverlay option to disable codegen for particular types
|
- [schema] Add IsOverlay option to disable codegen for particular types
|
||||||
[#8338](https://github.com/pulumi/pulumi/pull/8338)
|
[#8338](https://github.com/pulumi/pulumi/pull/8338)
|
||||||
|
[#8425](https://github.com/pulumi/pulumi/pull/8425)
|
||||||
|
|
||||||
- [sdk/dotnet] - Marshal output values.
|
- [sdk/dotnet] - Marshal output values.
|
||||||
[#8316](https://github.com/pulumi/pulumi/pull/8316)
|
[#8316](https://github.com/pulumi/pulumi/pull/8316)
|
||||||
|
|
|
@ -57,6 +57,14 @@ The description of the package. Descriptions are interpreted as Markdown.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### `displayName`
|
||||||
|
|
||||||
|
The human-friendly name of the package.
|
||||||
|
|
||||||
|
`string`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### `functions`
|
### `functions`
|
||||||
|
|
||||||
A map from token to functionSpec that describes the set of functions defined by this package.
|
A map from token to functionSpec that describes the set of functions defined by this package.
|
||||||
|
@ -159,6 +167,14 @@ The provider type for this package.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### `publisher`
|
||||||
|
|
||||||
|
The name of the person or organization that authored and published the package.
|
||||||
|
|
||||||
|
`string`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### `repository`
|
### `repository`
|
||||||
|
|
||||||
The URL at which the package's sources can be found.
|
The URL at which the package's sources can be found.
|
||||||
|
@ -361,6 +377,14 @@ The bag of input values for the function, if any.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
#### `isOverlay`
|
||||||
|
|
||||||
|
Indicates that the implementation of the function should not be generated from the schema, and is instead provided out-of-band by the package author
|
||||||
|
|
||||||
|
`boolean`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
#### `language`
|
#### `language`
|
||||||
|
|
||||||
Additional language-specific data about the function.
|
Additional language-specific data about the function.
|
||||||
|
@ -661,7 +685,7 @@ Indicates whether the resource is a component.
|
||||||
|
|
||||||
#### `isOverlay`
|
#### `isOverlay`
|
||||||
|
|
||||||
Indicates whether the resource is an overlay (code is generated by the package rather than by the core Pulumi codegen).
|
Indicates that the implementation of the resource should not be generated from the schema, and is instead provided out-of-band by the package author
|
||||||
|
|
||||||
`boolean`
|
`boolean`
|
||||||
|
|
||||||
|
@ -699,7 +723,7 @@ An optional objectTypeSpec that describes additional inputs that mau be necessar
|
||||||
|
|
||||||
`string`
|
`string`
|
||||||
|
|
||||||
Pattern: `^[a-zA-Z][-a-zA-Z0-9_]*:([^0-9][a-zA-Z0-9._/]*)?:[^0-9][a-zA-Z0-9._/]*$`
|
Pattern: `^[a-zA-Z][-a-zA-Z0-9_]*:([^0-9][a-zA-Z0-9._/-]*)?:[^0-9][a-zA-Z0-9._/]*$`
|
||||||
|
|
||||||
## Type Definition
|
## Type Definition
|
||||||
|
|
||||||
|
@ -721,6 +745,14 @@ The description of the type, if any. Interpreted as Markdown.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
#### `isOverlay`
|
||||||
|
|
||||||
|
Indicates that the implementation of the type should not be generated from the schema, and is instead provided out-of-band by the package author
|
||||||
|
|
||||||
|
`boolean`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
#### `language`
|
#### `language`
|
||||||
|
|
||||||
Additional language-specific data about the type.
|
Additional language-specific data about the type.
|
||||||
|
|
|
@ -2352,8 +2352,10 @@ func generateModuleContextMap(tool string, pkg *schema.Package) (map[string]*mod
|
||||||
mod := getModFromToken(typ.Token, pkg)
|
mod := getModFromToken(typ.Token, pkg)
|
||||||
mod.types = append(mod.types, typ)
|
mod.types = append(mod.types, typ)
|
||||||
case *schema.EnumType:
|
case *schema.EnumType:
|
||||||
mod := getModFromToken(typ.Token, pkg)
|
if !typ.IsOverlay {
|
||||||
mod.enums = append(mod.enums, typ)
|
mod := getModFromToken(typ.Token, pkg)
|
||||||
|
mod.enums = append(mod.enums, typ)
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -2769,8 +2769,10 @@ func generatePackageContextMap(tool string, pkg *schema.Package, goInfo GoPackag
|
||||||
}
|
}
|
||||||
populateDetailsForPropertyTypes(seenMap, typ.Properties, false)
|
populateDetailsForPropertyTypes(seenMap, typ.Properties, false)
|
||||||
case *schema.EnumType:
|
case *schema.EnumType:
|
||||||
pkg := getPkgFromToken(typ.Token)
|
if !typ.IsOverlay {
|
||||||
pkg.enums = append(pkg.enums, typ)
|
pkg := getPkgFromToken(typ.Token)
|
||||||
|
pkg.enums = append(pkg.enums, typ)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,16 @@
|
||||||
},
|
},
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
|
"example::EnumOverlay": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
{
|
||||||
|
"name": "SomeEnumValue",
|
||||||
|
"value": "SOME_ENUM_VALUE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"isOverlay": true
|
||||||
|
},
|
||||||
"example::ConfigMapOverlay": {
|
"example::ConfigMapOverlay": {
|
||||||
"isOverlay": true,
|
"isOverlay": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -25,11 +35,17 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"foo": {
|
"foo": {
|
||||||
"$ref": "#/types/example::ConfigMapOverlay"
|
"$ref": "#/types/example::ConfigMapOverlay"
|
||||||
|
},
|
||||||
|
"bar": {
|
||||||
|
"$ref": "#/types/example::EnumOverlay"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"inputProperties": {
|
"inputProperties": {
|
||||||
"foo": {
|
"foo": {
|
||||||
"$ref": "#/types/example::ConfigMapOverlay"
|
"$ref": "#/types/example::ConfigMapOverlay"
|
||||||
|
},
|
||||||
|
"bar": {
|
||||||
|
"$ref": "#/types/example::EnumOverlay"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"type": "object"
|
"type": "object"
|
||||||
|
@ -39,11 +55,17 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"foo": {
|
"foo": {
|
||||||
"$ref": "#/types/example::ConfigMapOverlay"
|
"$ref": "#/types/example::ConfigMapOverlay"
|
||||||
|
},
|
||||||
|
"bar": {
|
||||||
|
"$ref": "#/types/example::EnumOverlay"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"inputProperties": {
|
"inputProperties": {
|
||||||
"foo": {
|
"foo": {
|
||||||
"$ref": "#/types/example::ConfigMapOverlay"
|
"$ref": "#/types/example::ConfigMapOverlay"
|
||||||
|
},
|
||||||
|
"bar": {
|
||||||
|
"$ref": "#/types/example::EnumOverlay"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"type": "object"
|
"type": "object"
|
||||||
|
|
|
@ -27,6 +27,7 @@ no_edit_this_page: true
|
||||||
<div class="highlight"><pre class="chroma"><code class="language-python" data-lang="python"><span class=nd>@overload</span>
|
<div class="highlight"><pre class="chroma"><code class="language-python" data-lang="python"><span class=nd>@overload</span>
|
||||||
<span class="k">def </span><span class="nx">OverlayResource</span><span class="p">(</span><span class="nx">resource_name</span><span class="p">:</span> <span class="nx">str</span><span class="p">,</span>
|
<span class="k">def </span><span class="nx">OverlayResource</span><span class="p">(</span><span class="nx">resource_name</span><span class="p">:</span> <span class="nx">str</span><span class="p">,</span>
|
||||||
<span class="nx">opts</span><span class="p">:</span> <span class="nx"><a href="/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions">Optional[ResourceOptions]</a></span> = None<span class="p">,</span>
|
<span class="nx">opts</span><span class="p">:</span> <span class="nx"><a href="/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions">Optional[ResourceOptions]</a></span> = None<span class="p">,</span>
|
||||||
|
<span class="nx">bar</span><span class="p">:</span> <span class="nx">Optional[EnumOverlay]</span> = None<span class="p">,</span>
|
||||||
<span class="nx">foo</span><span class="p">:</span> <span class="nx">Optional[ConfigMapOverlayArgs]</span> = None<span class="p">)</span>
|
<span class="nx">foo</span><span class="p">:</span> <span class="nx">Optional[ConfigMapOverlayArgs]</span> = None<span class="p">)</span>
|
||||||
<span class=nd>@overload</span>
|
<span class=nd>@overload</span>
|
||||||
<span class="k">def </span><span class="nx">OverlayResource</span><span class="p">(</span><span class="nx">resource_name</span><span class="p">:</span> <span class="nx">str</span><span class="p">,</span>
|
<span class="k">def </span><span class="nx">OverlayResource</span><span class="p">(</span><span class="nx">resource_name</span><span class="p">:</span> <span class="nx">str</span><span class="p">,</span>
|
||||||
|
@ -157,6 +158,14 @@ The OverlayResource resource accepts the following [input]({{< relref "/docs/int
|
||||||
{{% choosable language csharp %}}
|
{{% choosable language csharp %}}
|
||||||
<dl class="resources-properties"><dt class="property-optional"
|
<dl class="resources-properties"><dt class="property-optional"
|
||||||
title="Optional">
|
title="Optional">
|
||||||
|
<span id="bar_csharp">
|
||||||
|
<a href="#bar_csharp" style="color: inherit; text-decoration: inherit;">Bar</a>
|
||||||
|
</span>
|
||||||
|
<span class="property-indicator"></span>
|
||||||
|
<span class="property-type"><a href="#enumoverlay">Pulumi.<wbr>Example.<wbr>Enum<wbr>Overlay</a></span>
|
||||||
|
</dt>
|
||||||
|
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||||
|
title="Optional">
|
||||||
<span id="foo_csharp">
|
<span id="foo_csharp">
|
||||||
<a href="#foo_csharp" style="color: inherit; text-decoration: inherit;">Foo</a>
|
<a href="#foo_csharp" style="color: inherit; text-decoration: inherit;">Foo</a>
|
||||||
</span>
|
</span>
|
||||||
|
@ -169,6 +178,14 @@ The OverlayResource resource accepts the following [input]({{< relref "/docs/int
|
||||||
{{% choosable language go %}}
|
{{% choosable language go %}}
|
||||||
<dl class="resources-properties"><dt class="property-optional"
|
<dl class="resources-properties"><dt class="property-optional"
|
||||||
title="Optional">
|
title="Optional">
|
||||||
|
<span id="bar_go">
|
||||||
|
<a href="#bar_go" style="color: inherit; text-decoration: inherit;">Bar</a>
|
||||||
|
</span>
|
||||||
|
<span class="property-indicator"></span>
|
||||||
|
<span class="property-type"><a href="#enumoverlay">Enum<wbr>Overlay</a></span>
|
||||||
|
</dt>
|
||||||
|
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||||
|
title="Optional">
|
||||||
<span id="foo_go">
|
<span id="foo_go">
|
||||||
<a href="#foo_go" style="color: inherit; text-decoration: inherit;">Foo</a>
|
<a href="#foo_go" style="color: inherit; text-decoration: inherit;">Foo</a>
|
||||||
</span>
|
</span>
|
||||||
|
@ -181,6 +198,14 @@ The OverlayResource resource accepts the following [input]({{< relref "/docs/int
|
||||||
{{% choosable language nodejs %}}
|
{{% choosable language nodejs %}}
|
||||||
<dl class="resources-properties"><dt class="property-optional"
|
<dl class="resources-properties"><dt class="property-optional"
|
||||||
title="Optional">
|
title="Optional">
|
||||||
|
<span id="bar_nodejs">
|
||||||
|
<a href="#bar_nodejs" style="color: inherit; text-decoration: inherit;">bar</a>
|
||||||
|
</span>
|
||||||
|
<span class="property-indicator"></span>
|
||||||
|
<span class="property-type"><a href="#enumoverlay">Enum<wbr>Overlay</a></span>
|
||||||
|
</dt>
|
||||||
|
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||||
|
title="Optional">
|
||||||
<span id="foo_nodejs">
|
<span id="foo_nodejs">
|
||||||
<a href="#foo_nodejs" style="color: inherit; text-decoration: inherit;">foo</a>
|
<a href="#foo_nodejs" style="color: inherit; text-decoration: inherit;">foo</a>
|
||||||
</span>
|
</span>
|
||||||
|
@ -193,6 +218,14 @@ The OverlayResource resource accepts the following [input]({{< relref "/docs/int
|
||||||
{{% choosable language python %}}
|
{{% choosable language python %}}
|
||||||
<dl class="resources-properties"><dt class="property-optional"
|
<dl class="resources-properties"><dt class="property-optional"
|
||||||
title="Optional">
|
title="Optional">
|
||||||
|
<span id="bar_python">
|
||||||
|
<a href="#bar_python" style="color: inherit; text-decoration: inherit;">bar</a>
|
||||||
|
</span>
|
||||||
|
<span class="property-indicator"></span>
|
||||||
|
<span class="property-type"><a href="#enumoverlay">Enum<wbr>Overlay</a></span>
|
||||||
|
</dt>
|
||||||
|
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||||
|
title="Optional">
|
||||||
<span id="foo_python">
|
<span id="foo_python">
|
||||||
<a href="#foo_python" style="color: inherit; text-decoration: inherit;">foo</a>
|
<a href="#foo_python" style="color: inherit; text-decoration: inherit;">foo</a>
|
||||||
</span>
|
</span>
|
||||||
|
@ -317,6 +350,28 @@ All [input](#inputs) properties are implicitly available as output properties. A
|
||||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||||
{{% /choosable %}}
|
{{% /choosable %}}
|
||||||
|
|
||||||
|
<h4 id="enumoverlay">Enum<wbr>Overlay</h4>
|
||||||
|
|
||||||
|
{{% choosable language csharp %}}
|
||||||
|
<dl class="tabular"><dt>Some<wbr>Enum<wbr>Value</dt>
|
||||||
|
<dd>SOME_ENUM_VALUE</dd></dl>
|
||||||
|
{{% /choosable %}}
|
||||||
|
|
||||||
|
{{% choosable language go %}}
|
||||||
|
<dl class="tabular"><dt>Enum<wbr>Overlay<wbr>Some<wbr>Enum<wbr>Value</dt>
|
||||||
|
<dd>SOME_ENUM_VALUE</dd></dl>
|
||||||
|
{{% /choosable %}}
|
||||||
|
|
||||||
|
{{% choosable language nodejs %}}
|
||||||
|
<dl class="tabular"><dt>Some<wbr>Enum<wbr>Value</dt>
|
||||||
|
<dd>SOME_ENUM_VALUE</dd></dl>
|
||||||
|
{{% /choosable %}}
|
||||||
|
|
||||||
|
{{% choosable language python %}}
|
||||||
|
<dl class="tabular"><dt>SOME_ENUM_VALUE</dt>
|
||||||
|
<dd>SOME_ENUM_VALUE</dd></dl>
|
||||||
|
{{% /choosable %}}
|
||||||
|
|
||||||
|
|
||||||
<h2 id="package-details">Package Details</h2>
|
<h2 id="package-details">Package Details</h2>
|
||||||
<dl class="package-details">
|
<dl class="package-details">
|
||||||
|
|
|
@ -66,6 +66,16 @@
|
||||||
},
|
},
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
|
"example::EnumOverlay": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
{
|
||||||
|
"name": "SomeEnumValue",
|
||||||
|
"value": "SOME_ENUM_VALUE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"isOverlay": true
|
||||||
|
},
|
||||||
"example::ConfigMapOverlay": {
|
"example::ConfigMapOverlay": {
|
||||||
"isOverlay": true,
|
"isOverlay": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -128,11 +138,17 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"foo": {
|
"foo": {
|
||||||
"$ref": "#/types/example::ConfigMapOverlay"
|
"$ref": "#/types/example::ConfigMapOverlay"
|
||||||
|
},
|
||||||
|
"bar": {
|
||||||
|
"$ref": "#/types/example::EnumOverlay"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"inputProperties": {
|
"inputProperties": {
|
||||||
"foo": {
|
"foo": {
|
||||||
"$ref": "#/types/example::ConfigMapOverlay"
|
"$ref": "#/types/example::ConfigMapOverlay"
|
||||||
|
},
|
||||||
|
"bar": {
|
||||||
|
"$ref": "#/types/example::EnumOverlay"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"type": "object"
|
"type": "object"
|
||||||
|
|
|
@ -2200,9 +2200,11 @@ func generateModuleContextMap(tool string, pkg *schema.Package, extraFiles map[s
|
||||||
case *schema.ObjectType:
|
case *schema.ObjectType:
|
||||||
types.types = append(types.types, typ)
|
types.types = append(types.types, typ)
|
||||||
case *schema.EnumType:
|
case *schema.EnumType:
|
||||||
info.ContainsEnums = true
|
if !typ.IsOverlay {
|
||||||
mod := getModFromToken(typ.Token)
|
info.ContainsEnums = true
|
||||||
mod.enums = append(mod.enums, typ)
|
mod := getModFromToken(typ.Token)
|
||||||
|
mod.enums = append(mod.enums, typ)
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -2722,8 +2722,10 @@ func generateModuleContextMap(tool string, pkg *schema.Package, info PackageInfo
|
||||||
mod.types = append(mod.types, typ)
|
mod.types = append(mod.types, typ)
|
||||||
}
|
}
|
||||||
case *schema.EnumType:
|
case *schema.EnumType:
|
||||||
mod := getModFromToken(typ.Token, pkg)
|
if !typ.IsOverlay {
|
||||||
mod.enums = append(mod.enums, typ)
|
mod := getModFromToken(typ.Token, pkg)
|
||||||
|
mod.enums = append(mod.enums, typ)
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -311,7 +311,7 @@
|
||||||
"required": ["environment"]
|
"required": ["environment"]
|
||||||
},
|
},
|
||||||
"deprecationMessage": {
|
"deprecationMessage": {
|
||||||
"description": "Indicates whether or not the property is deprecated",
|
"description": "Indicates whether the property is deprecated",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"language": {
|
"language": {
|
||||||
|
@ -340,6 +340,10 @@
|
||||||
"language": {
|
"language": {
|
||||||
"description": "Additional language-specific data about the type.",
|
"description": "Additional language-specific data about the type.",
|
||||||
"type": "object"
|
"type": "object"
|
||||||
|
},
|
||||||
|
"isOverlay": {
|
||||||
|
"description": "Indicates that the implementation of the type should not be generated from the schema, and is instead provided out-of-band by the package author",
|
||||||
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"oneOf": [
|
"oneOf": [
|
||||||
|
@ -409,7 +413,7 @@
|
||||||
"type": ["boolean", "integer", "number", "string"]
|
"type": ["boolean", "integer", "number", "string"]
|
||||||
},
|
},
|
||||||
"deprecationMessage": {
|
"deprecationMessage": {
|
||||||
"description": "Indicates whether or not the value is deprecated.",
|
"description": "Indicates whether the value is deprecated.",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -472,11 +476,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deprecationMessage": {
|
"deprecationMessage": {
|
||||||
"description": "Indicates whether or not the resource is deprecated",
|
"description": "Indicates whether the resource is deprecated",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"isComponent": {
|
"isComponent": {
|
||||||
"description": "Indicates whether or not the resource is a component.",
|
"description": "Indicates whether the resource is a component.",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"methods": {
|
"methods": {
|
||||||
|
@ -485,6 +489,10 @@
|
||||||
"additionalProperties": {
|
"additionalProperties": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"isOverlay": {
|
||||||
|
"description": "Indicates that the implementation of the resource should not be generated from the schema, and is instead provided out-of-band by the package author",
|
||||||
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -506,12 +514,16 @@
|
||||||
"$ref": "#/$defs/objectTypeSpec"
|
"$ref": "#/$defs/objectTypeSpec"
|
||||||
},
|
},
|
||||||
"deprecationMessage": {
|
"deprecationMessage": {
|
||||||
"description": "Indicates whether or not the function is deprecated",
|
"description": "Indicates whether the function is deprecated",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"language": {
|
"language": {
|
||||||
"description": "Additional language-specific data about the function.",
|
"description": "Additional language-specific data about the function.",
|
||||||
"type": "object"
|
"type": "object"
|
||||||
|
},
|
||||||
|
"isOverlay": {
|
||||||
|
"description": "Indicates that the implementation of the function should not be generated from the schema, and is instead provided out-of-band by the package author",
|
||||||
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,6 +166,10 @@ type EnumType struct {
|
||||||
Elements []*Enum
|
Elements []*Enum
|
||||||
// ElementType is the underlying type for the enum.
|
// ElementType is the underlying type for the enum.
|
||||||
ElementType Type
|
ElementType Type
|
||||||
|
|
||||||
|
// IsOverlay indicates whether the type is an overlay provided by the package. Overlay code is generated by the
|
||||||
|
// package rather than using the core Pulumi codegen libraries.
|
||||||
|
IsOverlay bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enum contains information about an enum.
|
// Enum contains information about an enum.
|
||||||
|
@ -968,8 +972,8 @@ func (pkg *Package) MarshalYAML() ([]byte, error) {
|
||||||
return b.Bytes(), nil
|
return b.Bytes(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (pkg *Package) marshalObjectData(
|
func (pkg *Package) marshalObjectData(comment string, properties []*Property, language map[string]interface{},
|
||||||
comment string, properties []*Property, language map[string]interface{}, plain bool) (ObjectTypeSpec, error) {
|
plain, isOverlay bool) (ObjectTypeSpec, error) {
|
||||||
|
|
||||||
required, props, err := pkg.marshalProperties(properties, plain)
|
required, props, err := pkg.marshalProperties(properties, plain)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -987,11 +991,12 @@ func (pkg *Package) marshalObjectData(
|
||||||
Type: "object",
|
Type: "object",
|
||||||
Required: required,
|
Required: required,
|
||||||
Language: lang,
|
Language: lang,
|
||||||
|
IsOverlay: isOverlay,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (pkg *Package) marshalObject(t *ObjectType, plain bool) (ComplexTypeSpec, error) {
|
func (pkg *Package) marshalObject(t *ObjectType, plain bool) (ComplexTypeSpec, error) {
|
||||||
data, err := pkg.marshalObjectData(t.Comment, t.Properties, t.Language, plain)
|
data, err := pkg.marshalObjectData(t.Comment, t.Properties, t.Language, plain, t.IsOverlay)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ComplexTypeSpec{}, err
|
return ComplexTypeSpec{}, err
|
||||||
}
|
}
|
||||||
|
@ -1010,17 +1015,16 @@ func (pkg *Package) marshalEnum(t *EnumType) ComplexTypeSpec {
|
||||||
}
|
}
|
||||||
|
|
||||||
return ComplexTypeSpec{
|
return ComplexTypeSpec{
|
||||||
ObjectTypeSpec: ObjectTypeSpec{Type: pkg.marshalType(t.ElementType, false).Type},
|
ObjectTypeSpec: ObjectTypeSpec{Type: pkg.marshalType(t.ElementType, false).Type, IsOverlay: t.IsOverlay},
|
||||||
Enum: values,
|
Enum: values,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (pkg *Package) marshalResource(r *Resource) (ResourceSpec, error) {
|
func (pkg *Package) marshalResource(r *Resource) (ResourceSpec, error) {
|
||||||
object, err := pkg.marshalObjectData(r.Comment, r.Properties, r.Language, true)
|
object, err := pkg.marshalObjectData(r.Comment, r.Properties, r.Language, true, r.IsOverlay)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ResourceSpec{}, fmt.Errorf("marshaling properties: %w", err)
|
return ResourceSpec{}, fmt.Errorf("marshaling properties: %w", err)
|
||||||
}
|
}
|
||||||
object.IsOverlay = r.IsOverlay
|
|
||||||
|
|
||||||
requiredInputs, inputs, err := pkg.marshalProperties(r.InputProperties, false)
|
requiredInputs, inputs, err := pkg.marshalProperties(r.InputProperties, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -2409,6 +2413,7 @@ func (t *types) bindEnumTypeDetails(enum *EnumType, token string, spec ComplexTy
|
||||||
enum.Elements = values
|
enum.Elements = values
|
||||||
enum.ElementType = typ
|
enum.ElementType = typ
|
||||||
enum.Comment = spec.Description
|
enum.Comment = spec.Description
|
||||||
|
enum.IsOverlay = spec.IsOverlay
|
||||||
|
|
||||||
return diags
|
return diags
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue