public class SwaggerToService extends java.lang.Object implements DiagCollector
Service instance from a Swagger object.| Constructor and Description |
|---|
SwaggerToService(com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> swaggerFilePathToContentMap,
java.lang.String serviceName,
java.lang.String typeNamespace,
java.lang.String methodNamespace,
com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> additionalConfigs)
Initializes Swagger to Service config converter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDiag(Diag diag)
Accumulates errors and warning encountered during import.
|
com.google.api.Service |
createServiceConfig()
Creates
Service from Swagger Object, and returns it. |
java.util.List<Diag> |
getDiags()
Returns the diagnosis accumulated.
|
int |
getErrorCount()
Returns the number of errors and warnings.
|
boolean |
hasErrors()
Returns true if there are any diagnosed proper errors; false otherwise
|
public SwaggerToService(com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> swaggerFilePathToContentMap,
java.lang.String serviceName,
java.lang.String typeNamespace,
java.lang.String methodNamespace,
com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> additionalConfigs)
throws SwaggerConversionException
swaggerFilePathToContentMap - Swagger files.serviceName - A service name to use for generated service config. If empty, service name
is extracted from the `host` field of the Swagger spec.typeNamespace - A namespace prefix used for all types in service config.methodNamespace - A namespace prefix used for all methods in service config.additionalConfigs - SwaggerConversionExceptionpublic com.google.api.Service createServiceConfig()
throws SwaggerConversionException
Service from Swagger Object, and returns it.SwaggerConversionExceptionpublic void addDiag(Diag diag)
addDiag in interface DiagCollectorpublic int getErrorCount()
getErrorCount in interface DiagCollectorpublic boolean hasErrors()
hasErrors in interface DiagCollectorpublic java.util.List<Diag> getDiags()
getDiags in interface DiagCollector