@classmethod<EOL><INDENT>def get_example_by_schema(cls, schema, ignored_schemas=None, paths=None, name='<STR_LIT>'):<DEDENT>
if schema.schema_example:<EOL><INDENT>return schema.schema_example<EOL><DEDENT>if ignored_schemas is None:<EOL><INDENT>ignored_schemas = []<EOL><DEDENT>if paths is None:<EOL><INDENT>paths = []<EOL><DEDENT>if name:<EOL><INDENT>paths = list(map(lambda path: '<STR_LIT:.>'.join((path, name)), paths))<EOL><DEDENT>if schema.ref_path:<EOL><INDENT>paths.append(schema.ref_path)<EOL><DEDENT>if schema.schema_id in ignored_schemas:<EOL><INDENT>result = [] if schema.is_array else {}<EOL><DEDENT>else:<EOL><INDENT>schemas = ignored_schemas + [schema.schema_id]<EOL>kwargs = dict(<EOL>ignored_schemas=schemas,<EOL>paths=paths<EOL>)<EOL>if schema.is_array:<EOL><INDENT>result = cls.get_example_for_array(<EOL>schema.item, **kwargs)<EOL><DEDENT>elif schema.type in PRIMITIVE_TYPES:<EOL><INDENT>result = cls.get_example_value_for_primitive_type(<EOL>schema.type, schema.raw, schema.type_format, paths=paths<EOL>)<EOL><DEDENT>elif schema.all_of:<EOL><INDENT>result = {}<EOL>for _schema_id in schema.all_of:<EOL><INDENT>schema = SchemaObjects.get(_schema_id)<EOL>result.update(cls.get_example_by_schema(schema, **kwargs))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>result = cls.get_example_for_object(<EOL>schema.properties, nested=schema.nested_schemas, **kwargs)<EOL><DEDENT><DEDENT>return result<EOL>
Get example by schema object

        :param Schema schema: current schema
        :param list ignored_schemas: list of previous schemas
            for avoid circular references
        :param list paths: list object paths (ex. #/definitions/Model.property)
            If nested schemas exists, custom examples checks in order from paths
        :param str name: name of property schema object if exists
        :return: dict or list (if schema is array)