Package org.teiid.translator.openapi
Class OpenAPIMetadataProcessor
- java.lang.Object
-
- org.teiid.translator.openapi.OpenAPIMetadataProcessor
-
- All Implemented Interfaces:
MetadataProcessor<WSConnection>
public class OpenAPIMetadataProcessor extends Object implements MetadataProcessor<WSConnection>
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOLLECION_FORMATstatic StringCONSUMESstatic StringKEY_NAMEstatic StringKEY_VALUEstatic StringMETHODstatic StringPARAMETER_TYPEstatic StringPRODUCESstatic StringURI-
Fields inherited from interface org.teiid.translator.MetadataProcessor
FQN, SOURCE_PREFIX
-
-
Constructor Summary
Constructors Constructor Description OpenAPIMetadataProcessor(OpenAPIExecutionFactory ef)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetMetadataUrl()static Map<io.swagger.v3.oas.models.PathItem.HttpMethod,io.swagger.v3.oas.models.Operation>getOperationMap(io.swagger.v3.oas.models.PathItem operations)StringgetPreferredConsumes()StringgetPreferredProduces()protected io.swagger.v3.parser.core.models.SwaggerParseResultgetSchema(WSConnection conn)StringgetServer()voidprocess(MetadataFactory mf, WSConnection connection)voidsetMetadataUrl(String metadataUrl)voidsetPreferredConsumes(String type)voidsetPreferredProduces(String accept)voidsetServer(String server)
-
-
-
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
-
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
-
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
-
OpenAPIMetadataProcessor
public OpenAPIMetadataProcessor(OpenAPIExecutionFactory ef)
-
-
Method Detail
-
getMetadataUrl
@TranslatorProperty(display="OpenAPI metadata URL", category=IMPORT, description="OpenAPI metadata URL") public String getMetadataUrl()
-
setMetadataUrl
public void setMetadataUrl(String metadataUrl)
-
getServer
@TranslatorProperty(display="Server", category=IMPORT, description="Server to use when multiple servers are defined") public String getServer()
-
setServer
public void setServer(String server)
-
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.v3.oas.models.PathItem.HttpMethod,io.swagger.v3.oas.models.Operation> getOperationMap(io.swagger.v3.oas.models.PathItem operations)
-
getSchema
protected io.swagger.v3.parser.core.models.SwaggerParseResult getSchema(WSConnection conn) throws TranslatorException
- Throws:
TranslatorException
-
-