openai / openai-openapi

OpenAPI specification for the OpenAI API
https://platform.openai.com/docs/api-reference/introduction
MIT License
1.19k stars 348 forks source link

Issues with the specification? #241

Open dcigic-wwc opened 4 months ago

dcigic-wwc commented 4 months ago

Trying to generate code with the openapi-generator-cli-6.2.0.jar

/Users/xxxx/Applications/Rider.app/Contents/jbr/Contents/Home/bin/java -jar /Users/xxxx/Library/Caches/JetBrains/Rider2024.1/openapi/codegen/71aab8d6724718f581fedb5bf4fd5866/openapi-generator-cli-6.2.0.jar generate -g csharp -i /Users/xxxx/dev/ConsoleApp4/ConsoleApp4/OpenAi.yaml -o /Users/xxxx/dev/ConsoleApp4/gen --additional-properties=packageName=OpenAi.Client,targetFramework=net8.0,sourceFolder=,modelPropertyNaming=PascalCase,netCoreProjectFile=true

I am getting these errors:

Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
 | Error count: 2, Warning count: 32
Errors: 
    -attribute components.schemas.CreateCompletionRequest.default is not of type `object`
    -attribute components.schemas.CreateChatCompletionRequest.default is not of type `object`

If I disable validation with --skip-validate-spec it generates code but there are a bunch of classes missing.

Not sure if this is an issue with the specs or the tool?

apollo-heidal commented 1 month ago

Same issue here.

Ovid commented 1 month ago

@dcigic-wwc I see you're trying to generate for C#. As a workaround, you might try this? https://github.com/RageAgainstThePixel/OpenAI-DotNet