Eliding namespace for code generation embedded in a module

Hello,
I am writing a command plugin (SPM) and I already have a module where I want to embed the generated source files. This is part of the outport object in the config file:

"schemaTypes" : {
      "moduleType" : {
        "embeddedInTarget" : {
          "accessModifier": "internal",
          "name": "MyModuleName" // ✨
        }
      },
      "path" : "./Generated/Types",
    },

The part that is bugging me is the fact the I have to specify a namespace for this generation:

{
  "schemaNamespace" : "Api",
  .. the rest of the config
}

Ideally I would like to not namespace the generated types.
I have tried passing an empty string, removing the "schemaNamespace" : "Api" key-value but they have resulted in errors.

So I would like to know if it is possible to not namespace the generated types?

Thanks

Hi @rajivjhoomuck, you should be able to use the .other value for your moduleType. You are then responsible for making sure your files are located in the correct place and linked to your target yourself. But you can get rid of the generated namespace that way.

See documentation on this feature here.

1 Like