Giter Site home page Giter Site logo

Comments (11)

sdelamo avatar sdelamo commented on May 12, 2024 8

It would be great to get Open API v3 validation.

from gradle-swagger-generator-plugin.

t2y avatar t2y commented on May 12, 2024 5

I am using 2.18.1 version. The validateSwagger task is failed when it validates openapi.yaml (3.0.2).

from gradle-swagger-generator-plugin.

int128 avatar int128 commented on May 12, 2024

At this time the JSON schema of OpenAPI 3.0 is not available yet (OAI/OpenAPI-Specification#1032). Please skip the validation.

Other tools seem:

from gradle-swagger-generator-plugin.

kevcodez avatar kevcodez commented on May 12, 2024

Is the plugin able to generate code when skipping the validation for OpenAPI 3.0?

from gradle-swagger-generator-plugin.

int128 avatar int128 commented on May 12, 2024

Yes. Just run the generateSwaggerCode task.

Sorry I have tested code generation with the latest snapshot version of swagger-codegen-cli but it does not work for now.

from gradle-swagger-generator-plugin.

darrelmiller avatar darrelmiller commented on May 12, 2024

Just an FYI, the JSON Schema will not be able to completely validate an OpenAPI document. It can partially validate it, but if you need a valid OpenAPI description you should not rely on JSON Schema.

from gradle-swagger-generator-plugin.

motorro avatar motorro commented on May 12, 2024

I've used jitpack to get plugin working. Used the commit I used to test my fix to generators:

// Substitute generators module
configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        if (details.requested.group == 'io.swagger' && details.requested.name == 'swagger-codegen-generators' && details.requested.version == '1.0.0-SNAPSHOT') {
            details.useTarget "com.github.motorro:swagger-codegen-generators:772f1c3e8b9efc7d7220c96067870471895054cb"
        }
    }
}

dependencies {
    // Codegen dependency
    swaggerCodegen 'com.github.swagger-api:swagger-codegen:b5c8b2162f5f34ff8db10c87461ea6e8aa066f76'
    // Generators dependency
    swaggerCodegen 'com.github.motorro:swagger-codegen-generators:772f1c3e8b9efc7d7220c96067870471895054cb'
}

Used as a temporary solution of course - just to get my model and API definition in a client project.

from gradle-swagger-generator-plugin.

krisztiankocsis avatar krisztiankocsis commented on May 12, 2024

Hi!
Can't use the new V3 generator because it is moved to a newer package.

Caused by: java.lang.IllegalStateException: Add swagger-codegen-cli to dependencies of the project as follows:
dependencies {
swaggerCodegen 'io.swagger:swagger-codegen-cli:x.x.x'
}
...
Caused by: java.lang.ClassNotFoundException: io.swagger.codegen.SwaggerCodegen

It is now:
io.swagger.codegen.v3:swagger-codegen-cli:3.0.0

When can we expect support for this one?

from gradle-swagger-generator-plugin.

int128 avatar int128 commented on May 12, 2024

Yes, the new 3.x line will be supported in the near future.

from gradle-swagger-generator-plugin.

int128 avatar int128 commented on May 12, 2024

I have released 2.14.0 and now it supports Swagger Codegen V3.
https://github.com/int128/gradle-swagger-generator-plugin/releases/tag/2.14.0

Note that it does not yet support OpenAPI 3 YAML validation.

from gradle-swagger-generator-plugin.

lorenet avatar lorenet commented on May 12, 2024

I have released 2.14.0 and now it supports Swagger Codegen V3.
https://github.com/int128/gradle-swagger-generator-plugin/releases/tag/2.14.0

Note that it does not yet support OpenAPI 3 YAML validation.

Hi!
I'm using version 2.16.0 and Swagger Codegen V3 doesn't seem to support Server Templating:

16:56:54.780 [Thread-388] WARN io.swagger.codegen.v3.utils.URLPathUtil - Not valid URL: https://test.api.com:{port}/{basePath}
java.net.MalformedURLException: For input string: "{port}"
at java.net.URL.(URL.java:627)
at java.net.URL.(URL.java:490)
at java.net.URL.(URL.java:439)
at io.swagger.codegen.v3.utils.URLPathUtil.getServerURL(URLPathUtil.java:30)
at io.swagger.codegen.v3.generators.java.SpringCodegen.preprocessOpenAPI(SpringCodegen.java:428)
at io.swagger.codegen.v3.DefaultGenerator.configureGeneratorProperties(DefaultGenerator.java:193)
at io.swagger.codegen.v3.DefaultGenerator.generate(DefaultGenerator.java:714)
at io.swagger.codegen.v3.cli.cmd.Generate.run(Generate.java:330)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NumberFormatException: For input string: "{port}"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.parseInt(Integer.java:615)
at java.net.URLStreamHandler.parseURL(URLStreamHandler.java:222)
at java.net.URL.(URL.java:622)
... 8 common frames omitted

from gradle-swagger-generator-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.