|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.smartbear.swagger4j.Swagger
public class Swagger
Utility methods to read/write/create Swagger objects
Method Summary | |
---|---|
static ApiDeclaration |
createApiDeclaration(String basePath,
String resourcePath)
Creates an empty ApiDeclaration with the specified basePath and resourcePath |
static SwaggerReader |
createReader()
Creates a SwaggerReader using the available SwaggerFactory |
static ResourceListing |
createResourceListing(String basePath)
Creates an empty ResourceListing with the specified basePath - uses the standard SwaggerFactory |
static SwaggerFactory |
createSwaggerFactory()
method for creating a SwaggerFactory; uses java.util.ServiceLoader to find a SwaggerFactory implementation - falls back to the default implementation if none are found |
static SwaggerWriter |
createWriter(Constants.Format format)
Creates a SwaggerWriter for the specified format using the default SwaggerFactory |
static ResourceListing |
readSwagger(URI uri)
Reads a Swagger definition from the specified URI, uses the default SwaggerReader implementation |
static void |
writeSwagger(ResourceListing resourceListing,
String path)
Writes the specified Swagger ResourceListing to the specified local path in json format. |
static void |
writeSwagger(ResourceListing resourceListing,
String path,
Constants.Format format)
Writes the specified Swagger ResourceListing to the specified local path in either json or xml format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ResourceListing createResourceListing(String basePath)
basePath
- the basePath to use for resolving paths to the API Declaration
public static ApiDeclaration createApiDeclaration(String basePath, String resourcePath)
basePath
- used to resolve API paths defined in this declarationresourcePath
- path to the actual resource described in the declaration
public static SwaggerReader createReader()
public static ResourceListing readSwagger(URI uri) throws IOException
uri
- the URI of the api-docs document defining the Swagger ResourceListing
IOException
public static void writeSwagger(ResourceListing resourceListing, String path) throws IOException
resourceListing
- the resourceListing to writepath
- path to an existing folder where the api-docs and api declarations will be written
IOException
public static void writeSwagger(ResourceListing resourceListing, String path, Constants.Format format) throws IOException
resourceListing
- the resourceListing to writepath
- path to an existing folder where the api-docs and api declarations will be writtenformat
- the format to use; either json or xml
IOException
public static SwaggerWriter createWriter(Constants.Format format)
format
- the format the writer should use, either json or xml
public static SwaggerFactory createSwaggerFactory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |