Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 3
0
 def test_paper(self, mock_index):
     """Request with single parameter paper."""
     _, _, _ = api.paper("1234.56789")
Exemplo n.º 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