gifted-island-55702
11/13/2025, 9:47 AMtype MyResourceArgs struct {
Name string `pulumi:"name"`
BusinessEntity schema.BusinessEntity `pulumi:"businessEntity"`
}
where schema.BusinessEntity is the struct generated by oapi-codegen from the OpenAPI spec and is a nested structure.
However, when I generate Python SDK using pulumi package gen-sdk --language python, the generated args input type includes the top-level struct (generated by oapi-codegen) and annotated in Python as pulumi.Input['_schema.BusinessEntityArgs' which is just:
@pulumi.input_type
class BusinessEntityArgs:
def __init__(__self__):
pass
so it’s missing all the nested fields.
What is the preferred way to handle this scenario?echoing-dinner-19531
11/13/2025, 10:03 AMpulumi package get-schema on the provider and seeing if that lists the nested fields.gifted-island-55702
11/13/2025, 10:11 AM{
"name": "myprovider",
"displayName": "yourdisplayname",
"version": "0.1.0",
"namespace": "example",
"meta": {
"moduleFormat": "(.*)"
},
"language": {
"csharp": {
"respectSchemaVersion": true
},
"go": {
"generateResourceContainerTypes": true,
"importBasePath": "github.com/example/yourdisplayname/sdk/go/yourdisplayname",
"respectSchemaVersion": true
},
"nodejs": {
"respectSchemaVersion": true
},
"python": {
"pyproject": {
"enabled": true
},
"respectSchemaVersion": true
}
},
"config": {},
"types": {
"myprovider:schema:BusinessEntity": {
"type": "object"
}
},
"provider": {
"type": "object"
},
"resources": {
"myprovider:index:MyResource": {
"properties": {
"name": {
"type": "string",
"description": "Name of the resource."
}
},
"type": "object",
"required": [
"name"
],
"inputProperties": {
"name": {
"type": "string",
"description": "Name of the resource."
},
"businessEntity": {
"$ref": "#/types/myprovider:schema:BusinessEntity"
}
},
"requiredInputs": [
"content",
"businessEntity"
]
}
}
}eechoing-dinner-19531
11/13/2025, 10:13 AMpulumi: tags on its fields?gifted-island-55702
11/13/2025, 10:13 AMgifted-island-55702
11/13/2025, 10:17 AMechoing-dinner-19531
11/13/2025, 10:20 AMgifted-island-55702
11/13/2025, 10:21 AMechoing-dinner-19531
11/13/2025, 10:24 AMgifted-island-55702
11/13/2025, 10:38 AMgifted-island-55702
11/13/2025, 11:02 AMAddresses *[]Address `json:"addresses,omitempty"`
How should the pulumi tag look like for this? (it’s not a primitive type like string and its also an array of custom type objects)?echoing-dinner-19531
11/13/2025, 11:37 AMpulumi:"addresses"gifted-island-55702
11/13/2025, 2:57 PMtype Organisation struct {
Name string `pulumi:"name"`
Settings *[]struct {
Name string `json:"name" pulumi:"name"`
} `json:"settings,omitempty" pulumi:"settings"`
}
type BusinessEntityArgs struct {
Organisation Organisation `pulumi:"organisation"`
}
when I run pulumi package get-schema I’m getting:
Compiling the program ...
Finished compiling
error: rpc error: code = Unknown desc = 1 error occurred:
* failed to get schema for 'file:index:File': could not serialize input type main.Organisation: invalid type '[]struct { Name string "json:\"name\" pulumi:\"name\"" }' on 'main.Organisation.Settings': type struct { Name string "json:\"name\" pulumi:\"name\"" } has no name
It seems it doesn’t handle *[]struct correctly, even though it’s tagged with
`json:"settings,omitempty" pulumi:"settings"`
Or am I missing something?gifted-island-55702
11/13/2025, 3:03 PM{
"schema": {
"components": {
"organisation": {
"type": "object",
"properties": {
"name": {
"type": "string",
"x-oapi-codegen-extra-tags": {
"pulumi": "name"
}
},
"settings": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"x-oapi-codegen-extra-tags": {
"pulumi": "name"
}
}
}
}
}
}
}
}
}
}echoing-dinner-19531
11/13/2025, 3:19 PMgifted-island-55702
11/13/2025, 3:26 PMechoing-dinner-19531
11/13/2025, 3:32 PMgifted-island-55702
11/13/2025, 3:33 PM