OpenAPITools / OpenAPITools/openapi-generator

[BUG] Could not initialize class org.openapitools.codegen.utils.ModelUtils using Gradle plugin

Open
#13,211 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Bug Report Checklist
Description

I'm trying to get a super simple example to work with the Gradle plugin. However, the generation failing no matter what generator is used with Could not initialize class org.openapitools.codegen.utils.ModelUtils

openapi-generator version

6.0.1

OpenAPI declaration file content or URL
---
openapi: 3.0.3
info:
  title: quarkus-openapi API
  version: 0.0.1-SNAPSHOT
paths:
  /api/playground/openapi:
    get:
      tags:
      - Some Controller
      responses:
        "200":
          description: OK

Generation Details
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':applications:playground:quarkus-openapi:openApiGenerate'.
> Could not initialize class org.openapitools.codegen.utils.ModelUtils

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
23:35:43: Execution finished 'openApiGenerate'.

Steps to reproduce
plugins {
    id 'io.quarkus'
    id "org.openapi.generator" version "6.0.1"
}


openApiGenerate {
    inputSpec = "$rootDir/applications/playground/quarkus-openapi/openapi.yaml".toString()
    outputDir = "$buildDir/generated".toString()
    generatorName = "java"
}

dependencies {
    implementation "io.quarkus:quarkus-smallrye-openapi"
}

What am I missing?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Gradle plugin configuration and the supplied openapi.yaml, then run the openApiGenerate task with --stacktrace to inspect the ModelUtils initialization failure. Compare the result with OpenAPI Generator 6.0.1 and the Quarkus Gradle setup; done means the minimal Java generation example completes successfully or the incompatibility is documented with a reproducible cause.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.