swagger-api / swagger-api/swagger-codegen

[JAVA] Rest-assured library not found in versions 3.0.x

Open
#9,252 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

I want to generate my Java sdk using the rest-assured library. This was available in 2.4.x but seems to have disappeared in 3.0.x.

Error:

[ERROR] Failed to execute goal io.swagger.codegen.v3:swagger-codegen-maven-plugin:3.0.5:generate (default) on project api: Execution default of goal io.swagger.codegen.v3:swagger-codegen-maven-plugin:3.0.5:generate failed: Unknown library: rest-assured
[ERROR] Available libraries:
[ERROR] jersey1
[ERROR] feign
[ERROR] jersey2
[ERROR] okhttp-gson
[ERROR] retrofit
[ERROR] retrofit2
[ERROR] resttemplate
[ERROR] resteasy
[ERROR] vertx
[ERROR] google-api-client
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

Plugin configuration:

<plugin>
  <groupId>io.swagger.codegen.v3</groupId>
  <artifactId>swagger-codegen-maven-plugin</artifactId>
  <version>3.0.5</version>
  <executions>
    <execution>
      <phase>compile</phase>
      <goals>
        <goal>generate</goal>
      </goals>
      <configuration>
        <output>xxx</output>
        <inputSpec>xxx</inputSpec>
        <language>java</language>
        <groupId>xxx</groupId>
        <artifactId>xxx</artifactId>
        <artifactVersion>xxx</artifactVersion>
        <invokerPackage>xxx</invokerPackage>
        <apiPackage>xxx</apiPackage>
        <modelPackage>xxx</modelPackage>
        <generateApiTests>false</generateApiTests>
        <configOptions>
          <dateLibrary>joda</dateLibrary>
        </configOptions>
        <library>rest-assured</library>
      </configuration>
    </execution>
  </executions>
</plugin>
Swagger-codegen version

2.4.0 (http://central.maven.org/maven2/io/swagger/swagger-codegen-maven-plugin/2.4.0/)

3.0.0 (http://central.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-maven-plugin/3.0.0/)

3.0.5 (http://central.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-maven-plugin/3.0.5/)

Swagger declaration file content or url
Command line used for generation

mvn clean install -DskipTests=true

Steps to reproduce

Run the command line command shown above

Related issues/PRs
Suggest a fix/enhancement

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 by reproducing the reported Maven generation command with swagger-codegen 3.0.5 and compare the Java generator's available libraries with version 2.4.x. Trace how the rest-assured option is registered and verify that generation accepts it and produces the expected Java SDK without the unknown-library error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.