Swagger codegen with multiple swagger json - swagger-codegen

I am trying to generate nodejs client sdk using https://github.com/swagger-api/swagger-codegen
Here is the command I use
swagger-codegen generate -i http://petstore.swagger.io/v2/swagger.json -l javascript -o ./petstore
But for the actual sdk which I need to generate the swagger spec is split in two different json files and I want to create a single sdk for both. How can I do this with Swagger-codegen, using multiple swagger json at same time?

Reuse the --input-spec option (or -i) for every location of the swagger spec, as URL or file.

Related

Customize the html and css of Code generated using swagger codegen

Unable to customize the html and css of Code which generated using swagger codegen
You can use the -t option with customized templates (mustache) to meet your requirement

How to Export Swagger documentation in PDF and XML files

I have generated swagger document for web api using below link:
http://wmpratt.com/swagger-and-asp-net-web-api-part-1/
Need to export document in PDF or XML file to send across handy.
Its .NET WEB API.
How to export swagger documentation ?
Thanks
Here's what I did today, since many of these other projects require laborious workarounds or extra libraries or some completely separate language.
Go to https://editor.swagger.io/ (Make sure it's the HTTPS version)
At the top, click File => Import File.
Select your Swagger JSON file.
At the top, click Generate Client => HTML2 and download the ZIP file.
This yields a static HTML page that you can then print (via the browser) to PDF using the built-in Microsoft Print to PDF printer, or Adobe Acrobat, or whatever else you might want to use.
You can use Swagger2Markup and AsciiDoc docker images:
docker run --rm -v $(pwd):/opt swagger2markup/swagger2markup convert -i "https://api.example.org/api/doc/swagger.json" -f /opt/swagger-doc
Creates asciidoc file named 'swagger-doc.adoc' in current folder.
docker run -it -v $(pwd):/documents/ asciidoctor/docker-asciidoctor asciidoctor-pdf swagger-doc.adoc
Creates a PDF file named 'swagger-doc.pdf' in current folder.
The Swagger2Markup project is on GitHub and some more information you'll find by using Google too.
Swagger2Markup converts a Swagger JSON or YAML file into several AsciiDoc or GitHub Flavored Markdown documents which can be combined with hand-written documentation.
AsciiDoc is preferable to Markdown as it has more features. AsciiDoc is a text document format for writing documentation, articles, books, ebooks, slideshows, web pages and blogs. AsciiDoc files can be converted to HTML, PDF and EPUB. AsciiDoc is much better suited for describing public APIs than JavaDoc or Annotations.
You can generate your HTML5, PDF and EPUB documentation via asciidoctorj or even better via the asciidoctor-gradle-plugin or asciidoctor-maven-plugin.
The project requires at least JDK 8.
See also RESTful API Documentation with Swagger and AsciiDoc
Their is no such tool or functionality to export swagger documentation into PDF or any other doc. You need to convert your swagger.json file to yaml file then u can get swagger as html doc form http://editor.swagger.io/.

Download artifacts archive from Artifactory

I'm testing Artifactory 4.2.0 PRO.
The really nice feature is the possibility to download an archive of all files produced by the build by executing, something like:
curl -XPOST -u admin:password -H "Content-Type: application/json" http://localhost:8081/artifactory/api/archive/buildArtifacts -d '
{
"buildName": "Vehicle Routing Problem",
"buildNumber": "3",
"archiveType": "zip"
}' > build.zip
However, I'm unable to find if there is a possibility to do the same (download archive) when specifying exact properties using AQL. I have been trying to upload other artifacts with properties exactly the same as those pushed by the build, but they were not fetch by the snippet above (I assume some sort of metadata is stored somewhere).
What are the possibilities to fetch multiple artifacts without using many HTTP queries?
Regards.
The Retrieve Folder or Repository Archive API allows to download an archive file (supports zip/tar/tar.gz/tgz) containing all the artifacts that reside under the specified path (folder or repository root). However it does not support filtering by properties.
The Artifactory CLI supports concurrently downloading multiple files. It also supports downloading files we matches a set of property values. The CLI, however, will use multiple HTTP requests for doing so.
A third option would be developing a custom user plugin which allows downloading an archive of artifacts matching a set of properties. An execution user plugin can be executed as a REST API call. There is a sample plugin in the JFrogDev GitHub account which can serve as a good start point. This plugin allows downloading the content of a directory as an archive.

Displaying YAML metadata in PDF file using Uberdoc

Is there a way to get Uberdoc to use the YAML block somehow? Uberdoc is a kind of build system on top of Pandoc, and Pandoc understands YAML. I'm generating a PDF on a mac like so:
uberdoc build -p
I know I can do a basic title page using % Some Title\n% Some author, but I was after YAML if it's possible.

How do I generate the API docs/documentation for Magento?

I have Magento installed and I wanted to know how to generate the full API docs, like the ones on http://docs.magentocommerce.com/ that were generated using phpdoc. Is there a configuration file included with Magento for phpdoc that I can use to generate the documentation?
The actual program is called phpDocumentor and you can use it on the command-line to document the core Magento code by using phpdoc -d $MAGENTO_PATH/app/code/core/Mage/ -t docs. Don't forget get to create a directory called docs, or you can set the target directory to whatever you want.
To document the API of an extension you can use phpdoc -d $MAGENTO_PATH/app/code/local/$PACKAGE/$MODULE where $PACKAGE is the package name, and $MODULE is the name of the module, and $MAGENTO_PATH is where Magento is installed.
Warning: it could take a while to generate all the API documentation as Magento is a pretty big program.