Package org.teiid.translator.swagger
Class SwaggerMetadataProcessor
- java.lang.Object
-
- org.teiid.translator.swagger.SwaggerMetadataProcessor
-
- All Implemented Interfaces:
MetadataProcessor<WSConnection>
public class SwaggerMetadataProcessor extends Object implements MetadataProcessor<WSConnection>
-
-
Field Summary
Fields Modifier and Type Field Description static StringCHARSETstatic StringCOLLECION_FORMATstatic StringCONSUMESstatic StringKEY_NAMEstatic StringKEY_VALUEstatic StringMETHODstatic StringPARAMETER_TYPEstatic StringPRODUCESstatic StringSCHEMEstatic StringURI-
Fields inherited from interface org.teiid.translator.MetadataProcessor
FQN, SOURCE_PREFIX
-
-
Constructor Summary
Constructors Constructor Description SwaggerMetadataProcessor(SwaggerExecutionFactory ef)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Map<io.swagger.models.HttpMethod,io.swagger.models.Operation>getOperationMap(io.swagger.models.Path operations)StringgetPreferredConsumes()StringgetPreferredProduces()StringgetPreferredScheme()protected io.swagger.models.SwaggergetSchema(WSConnection conn)StringgetSwaggerFilePath()booleanisUseDefaultHost()voidprocess(MetadataFactory mf, WSConnection connection)voidsetPreferredConsumes(String type)voidsetPreferredProduces(String accept)voidsetPreferredScheme(String scheme)voidsetSwaggerFilePath(String swaggerFilePath)voidsetUseDefaultHost(boolean useDefault)
-
-
-
Field Detail
-
KEY_NAME
public static final String KEY_NAME
- See Also:
- Constant Field Values
-
KEY_VALUE
public static final String KEY_VALUE
- See Also:
- Constant Field Values
-
URI
@ExtensionMetadataProperty(applicable=org.teiid.metadata.Procedure.class, datatype=java.lang.String.class, display="URI", description="Used to define endpoint of the procedure", required=true) public static final String URI
- See Also:
- Constant Field Values
-
METHOD
@ExtensionMetadataProperty(applicable=org.teiid.metadata.Procedure.class, datatype=java.lang.String.class, display="Http Method", description="Http method used to execute the procedure", required=true, allowed="GET,POST,PUT,DELETE,OPTIONS,HEAD,PATCH") public static final String METHOD
- See Also:
- Constant Field Values
-
SCHEME
@ExtensionMetadataProperty(applicable=org.teiid.metadata.Procedure.class, datatype=java.lang.String.class, display="Scheme", description="Scheme to use http, https etc.", allowed="HTTP,HTTPS") public static final String SCHEME
- See Also:
- Constant Field Values
-
PRODUCES
@ExtensionMetadataProperty(applicable=org.teiid.metadata.Procedure.class, datatype=java.lang.String.class, display="Produces", description="Used to define content type produced by this procedure, default JSON assumed") public static final String PRODUCES
- See Also:
- Constant Field Values
-
CONSUMES
@ExtensionMetadataProperty(applicable=org.teiid.metadata.Procedure.class, datatype=java.lang.String.class, display="Consumes", description="Used to define content type consumed by this procedure with body type parameters. Default JSON assumed") public static final String CONSUMES
- See Also:
- Constant Field Values
-
CHARSET
@ExtensionMetadataProperty(applicable=org.teiid.metadata.Procedure.class, datatype=java.lang.String.class, display="Charset", description="Encoding of the return data") public static final String CHARSET
- See Also:
- Constant Field Values
-
PARAMETER_TYPE
@ExtensionMetadataProperty(applicable=org.teiid.metadata.ProcedureParameter.class, datatype=java.lang.String.class, display="Parameter Type", description="Parameter type, as to how the parameter is being provided to the procedure", required=true, allowed="PATH,QUERY,FORM,FORMDATA,BODY,HEADER") public static final String PARAMETER_TYPE
- See Also:
- Constant Field Values
-
COLLECION_FORMAT
@ExtensionMetadataProperty(applicable=org.teiid.metadata.ProcedureParameter.class, datatype=java.lang.String.class, display="Collection Format", description="Determines the format of the array if type array is used, like CSV,TSV etc.", allowed="CSV,SSV,TSV,PIPES,MULTI") public static final String COLLECION_FORMAT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SwaggerMetadataProcessor
public SwaggerMetadataProcessor(SwaggerExecutionFactory ef)
-
-
Method Detail
-
getSwaggerFilePath
@TranslatorProperty(display="Swagger metadata file path", category=IMPORT, description="Swagger metadata file path.") public String getSwaggerFilePath()
-
setSwaggerFilePath
public void setSwaggerFilePath(String swaggerFilePath)
-
isUseDefaultHost
@TranslatorProperty(display="Use Host from Swagger File", category=IMPORT, description="Use default host specified in the Swagger file; Defaults to true") public boolean isUseDefaultHost()
-
setUseDefaultHost
public void setUseDefaultHost(boolean useDefault)
-
getPreferredScheme
@TranslatorProperty(display="Preferred Scheme", category=IMPORT, description="Preferred Scheme to use when Swagger file supports multiple invocation schemes like http, https etc.") public String getPreferredScheme()
-
setPreferredScheme
public void setPreferredScheme(String scheme)
-
getPreferredProduces
@TranslatorProperty(display="Preferred Accept Header", category=IMPORT, description="Preferred Accept MIME type header, this should be one of the Swagger \'produces\' types; default is application/json") public String getPreferredProduces()
-
setPreferredProduces
public void setPreferredProduces(String accept)
-
getPreferredConsumes
@TranslatorProperty(display="Preferred Content-type Header", category=IMPORT, description="Preferred Content-type header, this should be one of the Swagger \'consume\' types, default is application/json") public String getPreferredConsumes()
-
setPreferredConsumes
public void setPreferredConsumes(String type)
-
process
public void process(MetadataFactory mf, WSConnection connection) throws TranslatorException
- Specified by:
processin interfaceMetadataProcessor<WSConnection>- Throws:
TranslatorException
-
getOperationMap
public static Map<io.swagger.models.HttpMethod,io.swagger.models.Operation> getOperationMap(io.swagger.models.Path operations)
-
getSchema
protected io.swagger.models.Swagger getSchema(WSConnection conn) throws TranslatorException
- Throws:
TranslatorException
-
-