OpenAPI Codegen failing for "Given type is not array!"

Hi, I’m trying to call OpenAI API via OpenAPI (the service provides openapi yaml file).

When I use tapir codegen plugin, tapir fails:

  • Missing required field
    • Added required: [] for that resource and fixed.
  • Given type is not array!
    • I cannot fix this because it is actually not an array.

Error message follows:

DecodingFailure(Given type is not array!, List(DownField(CreateCompletionRequest), DownField(schemas), DownField(components)))

Corresponding schema is here.

The codegen plugin is in an experimental stage, quite possible some features are missing. We would need a smaller reproducing example to start fixing this.

However, something that I wanted to do as well (but so far fell short on time :wink: ), is to release an sttp+openapi integration layer, starting by generating the request descriptions using OpenAPI-codegen. It doesn’t give you tapir endpoint descriptions, but you get sttp client request descriptions - not sure if that will be enough for your use-case?

1 Like