public class Swagger2MarkupConverter
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Swagger2MarkupConverter.Builder |
static class |
Swagger2MarkupConverter.Context |
| Constructor and Description |
|---|
Swagger2MarkupConverter(Swagger2MarkupConverter.Context context) |
| Modifier and Type | Method and Description |
|---|---|
static Swagger2MarkupConverter.Builder |
from(java.nio.file.Path swaggerPath)
Creates a Swagger2MarkupConverter.Builder using a local Path.
|
static Swagger2MarkupConverter.Builder |
from(java.io.Reader swaggerReader)
Creates a Swagger2MarkupConverter.Builder from a given Swagger YAML or JSON reader.
|
static Swagger2MarkupConverter.Builder |
from(java.lang.String swaggerString)
Creates a Swagger2MarkupConverter.Builder from a given Swagger YAML or JSON String.
|
static Swagger2MarkupConverter.Builder |
from(io.swagger.models.Swagger swagger)
Creates a Swagger2MarkupConverter.Builder from a given Swagger model.
|
static Swagger2MarkupConverter.Builder |
from(java.net.URI swaggerUri)
Creates a Swagger2MarkupConverter.Builder from a URI.
|
static Swagger2MarkupConverter.Builder |
from(java.net.URL swaggerURL)
Creates a Swagger2MarkupConverter.Builder using a remote URL.
|
Swagger2MarkupConverter.Context |
getContext()
Returns the global Context
|
void |
toFile(java.nio.file.Path outputFile)
Converts the Swagger specification the given
outputFile. |
void |
toFileWithoutExtension(java.nio.file.Path outputFile)
Converts the Swagger specification the given
outputFile. |
void |
toFolder(java.nio.file.Path outputDirectory)
Converts the Swagger specification into the given
outputDirectory. |
void |
toPath(java.nio.file.Path outputPath)
Converts the Swagger specification into the
outputPath which can be either a directory (e.g /tmp) or a file without extension (e.g /tmp/swagger). |
java.lang.String |
toString()
Builds the document returns it as a String.
|
public Swagger2MarkupConverter(Swagger2MarkupConverter.Context context)
public static Swagger2MarkupConverter.Builder from(java.net.URI swaggerUri)
swaggerUri - the URIpublic static Swagger2MarkupConverter.Builder from(java.net.URL swaggerURL)
swaggerURL - the remote URLpublic static Swagger2MarkupConverter.Builder from(java.nio.file.Path swaggerPath)
swaggerPath - the local Pathpublic static Swagger2MarkupConverter.Builder from(io.swagger.models.Swagger swagger)
swagger - the Swagger source.public static Swagger2MarkupConverter.Builder from(java.lang.String swaggerString)
swaggerString - the Swagger YAML or JSON String.public static Swagger2MarkupConverter.Builder from(java.io.Reader swaggerReader)
swaggerReader - the Swagger YAML or JSON reader.public Swagger2MarkupConverter.Context getContext()
public void toFolder(java.nio.file.Path outputDirectory)
outputDirectory.outputDirectory - the output directory pathpublic void toPath(java.nio.file.Path outputPath)
outputPath which can be either a directory (e.g /tmp) or a file without extension (e.g /tmp/swagger).
Internally the method invokes either toFolder or toFile. If the outputPath is a directory, the directory must exist.
Otherwise it cannot be determined if the outputPath is a directory or not.outputPath - the output pathpublic void toFile(java.nio.file.Path outputFile)
outputFile.outputFile - the output filepublic void toFileWithoutExtension(java.nio.file.Path outputFile)
outputFile.outputFile - the output filepublic java.lang.String toString()
toString in class java.lang.Object