I downloaded the OpenAI's OpenAPI Spec file and tried to generate and compile the client and faced a few issues and wonder if anyone knows the fix for it.
This is the specification: https://app.stainless.com/api/spec/documented/openai/openapi.documented.yml
However, this spec have some validation errors, so I used --skip-validate-spec to ignore them.
Steps I followed
Generated the code
openapi-generator generate \
-i openapi.documented.yml \
-g java \
-o openai-java-client \
--additional-properties=useJakartaEe=true,dateLibrary=java8,apiPackage=org.openapitools.client.api,modelPackage=org.openapitools.client.model \
--skip-validate-spec ;
Compiled the code:
cd openai-java-client;
mvn clean install;
Error observed
openai-java-client/src/main/java/org/openapitools/client/model/ComputerAction.java:[476,11] error: reference to Type is ambiguous
-
Curious why not use the existing openai java SDK? github.com/openai/openai-java It's generated from the OpenAPI spec using Stainless.cjav_dev– cjav_dev2025年12月04日 16:06:58 +00:00Commented Dec 4, 2025 at 16:06
-
I like to get this error resolved, probably going to make something useful along the way. I'll give a go with the sdk too. Thanks.MaduKan– MaduKan2025年12月09日 10:24:20 +00:00Commented Dec 9, 2025 at 10:24