def get_properties_by_type(self, type, recursive=True, parent_path="<STR_LIT>"):
if parent_path:<EOL><INDENT>parent_path += "<STR_LIT:.>"<EOL><DEDENT>if isinstance(type, str):<EOL><INDENT>if type == "<STR_LIT:*>":<EOL><INDENT>type = set(MAPPING_NAME_TYPE.keys()) - set(["<STR_LIT>", "<STR_LIT>", "<STR_LIT>"])<EOL><DEDENT>else:<EOL><INDENT>type = [type]<EOL><DEDENT><DEDENT>properties = []<EOL>for prop in list(self.properties.values()):<EOL><INDENT>if prop.type in type:<EOL><INDENT>properties.append((parent_path + prop.name, prop))<EOL>continue<EOL><DEDENT>elif prop.type == "<STR_LIT>" and prop.name in prop.fields and prop.fields[prop.name].type in type:<EOL><INDENT>properties.append((parent_path + prop.name, prop))<EOL>continue<EOL><DEDENT>if not recursive:<EOL><INDENT>continue<EOL><DEDENT>if prop.type in ["<STR_LIT>", "<STR_LIT:object>"]:<EOL><INDENT>properties.extend(<EOL>prop.get_properties_by_type(type, recursive=recursive, parent_path=parent_path + prop.name))<EOL><DEDENT><DEDENT>return sorted(properties)<EOL>
Returns a sorted list of fields that match the type.

:param type the type of the field "string","integer" or a list of types
:param recursive recurse to sub object
:returns a sorted list of fields the match the type