def response_schema(self):
        # parse the return schema
        instance = self._instance
        metadata = inspect.signature(self.method)
        if metadata.return_annotation is not metadata.empty:
            argtype = _parse_arg(instance, metadata.return_annotation)
            if 'type' in argtype:
                if argtype['type'] in {'list', 'object'}:
                    return argtype
                else:
                    return {
                        "type": "object",
                        "properties": {
                            "_": argtype
                        }
                    }
            elif "$ref" in argtype:
                coll = Reference(argtype['$ref'])
                return coll.get_collection().schema
            else:
                return {
                    "type": "object",
                    "properties": {
                        "_": argtype
                    }
                }
        else:
            return {"type": "object", "description": "no return value."}
dataset/ETHPy150Open JeffHeard/sondra/sondra/decorators.py/expose.response_schema/original