Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
The community reviewed whether to reopen this question 8 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
Are there any tools/libraries to convert OpenAPI 2.0 definitions to OpenAPI 3.0, without doing it one per row?
Swagger Editor
Paste your OpenAPI 2.0 definition into https://editor.swagger.io and select Edit > Convert to OpenAPI 3 from the menu.
Swagger Converter
Converts OpenAPI 2.0 and Swagger 1.x definitions to OpenAPI 3.0.
https://converter.swagger.io/api/convert?url=OAS2_YAML_OR_JSON_URL
This gives you JSON. If you want YAML, send the request with the Accept: application/yaml header:
curl "https://converter.swagger.io/api/convert?url=OAS2_YAML_OR_JSON_URL" -H "Accept: application/yaml" -o ./openapi.yaml
API docs: https://converter.swagger.io
GitHub repo: https://github.com/swagger-api/swagger-converter
Swagger Codegen version 3.x
Can also convert OpenAPI 2.0 and Swagger 1.x definitions to OpenAPI 3.0. Swagger Codegen has a CLI version, Maven plugin, Docker images.
Here's an example using the command-line version (you can download the latest JAR from Maven Central). Write the entire command on one line. Use openapi-yaml to get YAML or openapi to get JSON.
java -jar swagger-codegen-cli-3.0.19.jar generate
-l openapi-yaml
-i https://petstore.swagger.io/v2/swagger.yaml
-o OUT_DIR
GitHub repo: https://github.com/swagger-api/swagger-codegen
Related
I'm trying to generate client code for C#/asp.net core to consume a service that has a swagger 1.1 specification. (The service is out of my control). Unfortunately most up-to-date tools require at a swagger 1.2 spec. Most tools even require open-api 2.0. Even most converters start at 1.2. Does anybody know a tool to upgrade from 1.1 to 1.2?
I'd even consider a manual rewrite, but I can't find anywhere what changed between 1.1 and 1.2
First of all, 1.2 is also a very old version. Consider converting to OpenAPI 2.0 (used by most tools nowadays) or maybe even OpenAPI 3.0 (the latest version).
Swagger Codegen
Swagger Codegen can generate client/server code from 1.x-3.0 specs, and can also convert Swagger 1.x to OpenAPI 2.0 or 3.0.
To generate a C# client from a Swagger 1.x spec using Codegen CLI v. 2.x:
java -jar swagger-codegen-cli-2.4.0.jar generate
-i http://path/to/spec.json
-l csharp
-o ./csharp-client
To convert Swagger 1.x to OpenAPI 2.0, Codegen CLI v. 2.x with the -l swagger argument to get JSON or -l swagger-yaml to get YAML.
java -jar swagger-codegen-cli-2.4.0.jar generate
-i http://path/to/spec.json
-l swagger
-o ./converted
To convert to OpenAPI 3.0, use Codegen CLI v. 3.x with the -l openapi argument to get JSON or -l openapi-yaml to get YAML.
java -jar swagger-codegen-cli-3.0.3.jar generate
-i http://path/to/spec.json
-l openapi
-o ./converted
API Transformer
API Transformer claims to support Swagger 1.x -> 1.2 / 2.0 / 3.0 conversion.
I need to create swagger codegen client for java, javascript pointing to swagger yaml pusblished on https.
When tried below command got SSLHandshakeError.
"swagger-codegen generate -i https://localhost:443/api/swagger.yaml -l java -o java-api/."
Also when swagger codegen generates client will it have SSL Mutual TLS code for https swagger spec url?
Please help.
Please add -D io.swagger.parser.util.RemoteUrl.trustAll=true when generating the code.
Ref: https://github.com/swagger-api/swagger-codegen/wiki/FAQ#is-there-a-way-to-disable-certificate-verification
UPDATE: On May 2018, about 50 top contributors and template creators of Swagger Codegen decided to fork Swagger Codegen to maintain a community-driven version called OpenAPI Generator. Please refer to the Q&A for more information.
the above answer didn't work for me. if you are facing the same problem as I just use the bellow structure
( "swagger:generate": "SET JAVA_OPTS=-Dio.swagger.parser.util.RemoteUrl.trustAll=true -Dio.swagger.v3.parser.util.RemoteUrl.trustAll=true && openapi-generator generate -i https://xxxxxx/swagger/1.0/swagger.json -g typescript-angular -o ./src/code-gen"
)
that's how I solved it
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am really new to ruby on rails. I heard ruby on rails needs to java virtual machine to be run.
I would like to ask some basic stuff about the ruby on rails.
It seems like ruby on rails can have some native code in the source code.
From what I have researched about ruby on rails, the code is usually runnable on the same platform that the code is written.
So when we need to run the code on different platform, using the Bundler ( rubygems ), it can automatically download the right version of package.
Is this correct??
Also, for the packages, are there any packages or modules that are not written in pure ruby??
I am not sure if there is any. If there is, I think the package manager cannot automatically download the right version and developers need to pull it out and make changes to deploy on the other machines.
I wasn't sure how to look at package dependencies in the package.
Is there a way to find the package dependency??
It is not clear what question you are asking however perhaps I can resolve some of your confusion.
Rails is a framework, distributed as a Ruby gem package which runs as part of a Ruby app on one of several available Ruby interpreters.
Neither Ruby nor Rails depend on the JVM. The JRuby interpreter allows you to run Ruby code within the JVM if you choose to do so.
Many Ruby gems include native extensions which may be platform dependent. Bundler allows you to express platform specific dependencies in cases where you need to use different gems to supply the same interface on different platforms. Take a look at Bundler's platform command as a way to check if your current platform satisfies the requirements of a given gemfile.
For example the sqlite3 gem requires native C extensions which cannot be compiled to run on the JRuby platform. Projects which support JRuby must swap in an alternative like the activerecord-jdbcmysql-adapter gem.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Where can I find rails standalone installer package for the rails v.3.x.x?
I know I can use gem command and specify a particular version to download.
Is that available to download on some website like rubyforge?
Thanks in advance,
If you're using windows, you can use RailsInstaller
git clone git://github.com/rails/rails.git
git checkout v3.1.1
List all versions:
git tag -l
https://github.com/rails/rails
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Is there a way to run phantomjs, a command-line tool, on Heroku?
check out this buildpack:
https://github.com/stomita/heroku-buildpack-phantomjs
I also am able to run the x86_64 build of PhamtomJS, just stuck in my app's vendor directory:
http://phantomjs.org/download.html
In Version 1.5 we got rid of the Xvfb and Xlib dependencies.
Now this should be pretty simple.
I'd suggest:
checkout the source
build a binary with the given script (check the options to build the version without xvfb)
be happy :)
Ariya, the main author, also did a good job at incorporating Qt in our codebase directly, so we have a tailored, stripped down Qt that does just what PhantomJS needs and no more :)
I'm not familiar with Phantom, but it looks like a binary, in which case there's a Heroku buildpack which might help you out here:
https://github.com/ryandotsmith/null-buildpack