Using two packages in generated API clients

Hi,

I’m trying to use generated clients in python, with code coming from two NPL packages. I haven’t been able to have functions and objects for both packages in my generated client.

In details:
NPL code:

package iou;

@api
protocol[issuer, payee] Iou(var description: Text, var forAmount: Number) {};

package iks;
protocol[controlOwner] TestRun() {};

My pom file

                    <execution>
                        <id>streamlit-ui-iou</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>${project.basedir}/target/generated-sources/openapi/iou-openapi.yml</inputSpec>
                            <generatorName>python</generatorName>
                            <output>../streamlit-ui/generated-iou</output>
                        </configuration>
                    </execution>
                    <execution>
                        <id>streamlit-ui-iks</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>${project.basedir}/target/generated-sources/openapi/iks-openapi.yml</inputSpec>
                            <generatorName>python</generatorName>
                            <output>../streamlit-ui/generated-iks</output>
                        </configuration>
                    </execution>

and then installing sources

pip install ./generated-iks
pip install ./generated-iou

and whichever I install last I can use in the code, the other is unavailable.

How can I change my setup to be able to tab both into iks and iou generated code?

This seems to be a lack of configuration of the Python OpenAPI Generator:

By default, each Python OpenAPI generator run results in a package with the name openapi_client – so you end up with two different packages having the same name, which is bound to cause problems.

Try adding <packageName>...</packageName> to each configuration. For more information, please refer to the Python OpenAPI Generator Configuration options.

So… not really a Noumena Platform issue :slight_smile: