Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Open API 3.0 #86

Closed
kevcodez opened this issue Mar 12, 2018 · 11 comments
Closed

Open API 3.0 #86

kevcodez opened this issue Mar 12, 2018 · 11 comments

Comments

@kevcodez
Copy link

Does the plugin support pOpen API 3.0?

I tried using the petstore example and the validation fails.

@int128
Copy link
Owner

int128 commented Mar 13, 2018

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:

@kevcodez
Copy link
Author

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

@int128
Copy link
Owner

int128 commented Mar 14, 2018

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.

@darrelmiller
Copy link

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.

@motorro
Copy link

motorro commented Aug 7, 2018

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.

@krisztiankocsis
Copy link

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?

@int128
Copy link
Owner

int128 commented Oct 3, 2018

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

@int128
Copy link
Owner

int128 commented Oct 12, 2018

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.

@lorenet
Copy link

lorenet commented Mar 12, 2019

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

@sdelamo
Copy link

sdelamo commented Apr 1, 2019

It would be great to get Open API v3 validation.

@t2y
Copy link

t2y commented May 3, 2019

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants