Class SwaggerDocUtil
- java.lang.Object
-
- com.wavemaker.commons.swaggerdoc.util.SwaggerDocUtil
-
public class SwaggerDocUtil extends java.lang.ObjectSwaggerDocUtils is used to provided required component/s from the swagger document. Created by sunilp on 26/5/15.
-
-
Constructor Summary
Constructors Constructor Description SwaggerDocUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.wavemaker.tools.apidocs.tools.core.model.properties.PropertybuildProperty(java.lang.String type, java.lang.String format)Builds property based on given type and format.static java.lang.Class<?>findDateType(com.wavemaker.tools.apidocs.tools.core.model.properties.DateProperty property)static com.wavemaker.tools.apidocs.tools.core.model.OperationgetOperation(com.wavemaker.tools.apidocs.tools.core.model.Swagger swagger, java.lang.String endPoint, java.lang.String operationUid)Return Operation from the Swagger object based on operationUid in provided endPoint.static com.wavemaker.tools.apidocs.tools.core.model.OperationgetOperationByUid(com.wavemaker.tools.apidocs.tools.core.model.Swagger swagger, java.lang.String operationUid)Return Operation from the Swagger object based on first occurrence in pathsstatic java.lang.StringgetOperationType(com.wavemaker.tools.apidocs.tools.core.model.Path path, java.lang.String operationUid)Return method type of the operation in a pathstatic java.lang.StringgetParameterType(com.wavemaker.tools.apidocs.tools.core.model.parameters.Parameter parameter)static com.wavemaker.tools.apidocs.tools.core.model.PathgetPathByEndPoint(com.wavemaker.tools.apidocs.tools.core.model.Swagger swagger, java.lang.String endPoint)Return Path from the Swagger object based on endPointstatic com.wavemaker.tools.apidocs.tools.core.model.PathgetPathByOperationUid(com.wavemaker.tools.apidocs.tools.core.model.Swagger swagger, java.lang.String operationUid)Return Operation from the Path object based on first occurrence in pathsstatic java.util.Map<java.lang.String,com.wavemaker.tools.apidocs.tools.core.model.properties.Property>getProperties(com.wavemaker.tools.apidocs.tools.core.model.Swagger swagger, com.wavemaker.tools.apidocs.tools.core.model.Model model)static java.util.Map<java.lang.String,com.wavemaker.tools.apidocs.tools.core.model.properties.Property>getProperties(com.wavemaker.tools.apidocs.tools.core.model.Swagger swagger, com.wavemaker.tools.apidocs.tools.core.model.properties.Property property)static java.lang.StringgetWrapperPropertyFQType(com.wavemaker.tools.apidocs.tools.core.model.properties.Property property)Constructs fully qualified name for the give property based on property type and format.
-
-
-
Field Detail
-
FILE
public static final java.lang.String FILE
- See Also:
- Constant Field Values
-
ARRAY
public static final java.lang.String ARRAY
- See Also:
- Constant Field Values
-
STRING
public static final java.lang.String STRING
- See Also:
- Constant Field Values
-
-
Method Detail
-
getPathByEndPoint
public static com.wavemaker.tools.apidocs.tools.core.model.Path getPathByEndPoint(com.wavemaker.tools.apidocs.tools.core.model.Swagger swagger, java.lang.String endPoint)Return Path from the Swagger object based on endPoint- Parameters:
swagger- : Searches in Swagger ObjectendPoint- : search based on endPoint- Returns:
- Path
-
getPathByOperationUid
public static com.wavemaker.tools.apidocs.tools.core.model.Path getPathByOperationUid(com.wavemaker.tools.apidocs.tools.core.model.Swagger swagger, java.lang.String operationUid)Return Operation from the Path object based on first occurrence in paths- Parameters:
swagger- : searches in Swagger ObjectoperationUid- : search based on operationUid- Returns:
- path
-
getOperationByUid
public static com.wavemaker.tools.apidocs.tools.core.model.Operation getOperationByUid(com.wavemaker.tools.apidocs.tools.core.model.Swagger swagger, java.lang.String operationUid)Return Operation from the Swagger object based on first occurrence in paths- Parameters:
swagger- : searches in Swagger ObjectoperationUid- : search based on operationUid- Returns:
- Operation
-
getOperation
public static com.wavemaker.tools.apidocs.tools.core.model.Operation getOperation(com.wavemaker.tools.apidocs.tools.core.model.Swagger swagger, java.lang.String endPoint, java.lang.String operationUid)Return Operation from the Swagger object based on operationUid in provided endPoint.- Parameters:
swagger- : Searches in Swagger ObjectendPoint- : search operation in this endPointoperationUid- : search based on operationUid- Returns:
- Operation
-
getOperationType
public static java.lang.String getOperationType(com.wavemaker.tools.apidocs.tools.core.model.Path path, java.lang.String operationUid)Return method type of the operation in a path- Parameters:
path- : searches in path objectoperationUid- : search operation based on this id.- Returns:
- method type
-
buildProperty
public static com.wavemaker.tools.apidocs.tools.core.model.properties.Property buildProperty(java.lang.String type, java.lang.String format)Builds property based on given type and format.- Parameters:
type- : type of the propertyformat- : format of the property- Returns:
- Property, may returns null if type and format is not based on swagger property.
-
getWrapperPropertyFQType
public static java.lang.String getWrapperPropertyFQType(com.wavemaker.tools.apidocs.tools.core.model.properties.Property property)
Constructs fully qualified name for the give property based on property type and format.- Returns:
- fully qualified name for given property,Returns null if type and format is not based on swagger property.
-
getParameterType
public static java.lang.String getParameterType(com.wavemaker.tools.apidocs.tools.core.model.parameters.Parameter parameter)
-
findDateType
public static java.lang.Class<?> findDateType(com.wavemaker.tools.apidocs.tools.core.model.properties.DateProperty property)
-
getProperties
public static java.util.Map<java.lang.String,com.wavemaker.tools.apidocs.tools.core.model.properties.Property> getProperties(com.wavemaker.tools.apidocs.tools.core.model.Swagger swagger, com.wavemaker.tools.apidocs.tools.core.model.Model model)
-
getProperties
public static java.util.Map<java.lang.String,com.wavemaker.tools.apidocs.tools.core.model.properties.Property> getProperties(com.wavemaker.tools.apidocs.tools.core.model.Swagger swagger, com.wavemaker.tools.apidocs.tools.core.model.properties.Property property)
-
-