Пример #1
0
def paper(paper_id: str, version: str) -> Response:
    """Document metadata endpoint."""
    data, status_code, headers = api.paper(f'{paper_id}v{version}')
    response = serialize.as_json(data['results'])
    response.status_code = status_code
    response.headers.extend(headers)
    return response
Пример #2
0
def paper(paper_id: str, version: str) -> Response:
    """Document metadata endpoint."""
    data, status_code, headers = api.paper(f"{paper_id}v{version}")
    response_data = serialize.as_json(data["results"])
    headers.update({"Content-type": JSON})
    response: Response = make_response(response_data, status_code, headers)
    return response
Пример #3
0
 def test_paper(self, mock_index):
     """Request with single parameter paper."""
     _, _, _ = api.paper("1234.56789")
Пример #4
0
def paper(paper_id: str, version: str) -> Response:
    """Document metadata endpoint."""
    data, status_code, headers = api.paper(f'{paper_id}v{version}')
    return serialize.as_json(
        data['results']), status_code, headers  # type: ignore