I'm just on the finishing line for the `pulumi-for...
# package-authoring
b
I'm just on the finishing line for the
pulumi-fortios
provider. Because it has a huge amount of resources I want the different resources grouped into separate "namespaces" in the SDK. This works perfectly well for all languages except for the C# (Dotnet) Language generator, where it creates such incorrect namespace declarations
Pulumiverse.Fortios.Filter/dns.Inputs
. In the Typescript the generated code is correct (ref. screenshot). In
schema.json
the
ProfileDnsTranslation
object is declared as follows:
Copy code
"fortios:filter/dns/ProfileDnsTranslation:ProfileDnsTranslation": {
    "properties": {
        "addrType": {
            "type": "string",
            "description": "DNS translation type (IPv4 or IPv6). Valid values: `ipv4`, `ipv6`.\n"
        },
        "dst": {
            "type": "string",
            "description": "IPv4 address or subnet on the external network to substitute for the resolved address in DNS query replies. Can be single IP address or subnet on the external network, but number of addresses must equal number of mapped IP addresses in src.\n"
        },
        "dst6": {
            "type": "string",
            "description": "IPv6 address or subnet on the external network to substitute for the resolved address in DNS query replies. Can be single IP address or subnet on the external network, but number of addresses must equal number of mapped IP addresses in src6.\n"
        },
        "id": {
            "type": "integer",
            "description": "ID.\n"
        },
        "netmask": {
            "type": "string",
            "description": "If src and dst are subnets rather than single IP addresses, enter the netmask for both src and dst.\n"
        },
        "prefix": {
            "type": "integer",
            "description": "If src6 and dst6 are subnets rather than single IP addresses, enter the prefix for both src6 and dst6 (1 - 128, default = 128).\n"
        },
        "src": {
            "type": "string",
            "description": "IPv4 address or subnet on the internal network to compare with the resolved address in DNS query replies. If the resolved address matches, the resolved address is substituted with dst.\n"
        },
        "src6": {
            "type": "string",
            "description": "IPv6 address or subnet on the internal network to compare with the resolved address in DNS query replies. If the resolved address matches, the resolved address is substituted with dst6.\n"
        },
        "status": {
            "type": "string",
            "description": "Enable/disable this DNS translation entry. Valid values: `enable`, `disable`.\n"
        }
    },
    "type": "object",
    "language": {
        "nodejs": {
            "requiredOutputs": [
                "addrType",
                "dst",
                "dst6",
                "id",
                "netmask",
                "prefix",
                "src",
                "src6",
                "status"
            ]
        }
    }
},
Found the culprit in
codegen/dotnet/gen.go
Method `namespaceName`splits namespaces by using the
-
character, where I used
/
. @ancient-policeman-24615 @enough-garden-22763 Am I wrong with my namespace declarations using the
/
character, or is it a bug?
@tall-librarian-49374 do you have an opinion on this issue above in the dotnet codegen, wether if it's a bug or I'm specifying (sub-)namespace the wrong way?
a
It looks like this is a manifestation of https://github.com/pulumi/pulumi-dotnet/issues/25. I’ll ask if we can get this prioritized.
b
@ancient-policeman-24615 just opened a pull request to fix this (hopefully) @echoing-dinner-19531 got confused because I didn't create a separate issue and wasn't aware of your answer here so I opened the PR without a connected issue. Sorry for that! https://github.com/pulumi/pulumi/pull/14295
e
I'm looking at this now. I think it's a bit more involved than just splitting on "/"
b
@echoing-dinner-19531 I had the same hunch 🙂 But replacing "-" with "/" simply fixed my issue described above with the Fortios provider. However, I would prefer if the dotnet codegen would also create subdirectories instead of treating the namespaces as one namespace with Pascal casing. Just like the other codegens can do.
e
Yup, "my/module" should be "My.Module" with the nested directories to match
b
Exactly!
e
b
Awesome! Renders my PR obsolete. Let me close it.