Skip to content

Commit

Permalink
Correctly type document URIs as DocumentURIStrings
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksonj04 committed Nov 9, 2023
1 parent 146cbb2 commit 35b3b9c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/openapi_server/apis/reading_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import lxml.etree
from typing import Dict, List, Any # noqa: F401

from caselawclient.models.documents import DocumentURIString
from fastapi import ( # noqa: F401
APIRouter,
Body,
Expand Down Expand Up @@ -58,7 +58,7 @@ def unpack_list(xpath_list):
)
async def get_document_by_uri(
response: Response,
judgmentUri: str,
judgmentUri: DocumentURIString,
token_basic: TokenModel = Security(get_token_basic),
):
with error_handling():
Expand Down
10 changes: 6 additions & 4 deletions src/openapi_server/apis/writing_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from typing import Dict, List, Optional # noqa: F401

from caselawclient.models.documents import DocumentURIString

from fastapi import ( # noqa: F401
APIRouter,
Body,
Expand Down Expand Up @@ -49,7 +51,7 @@
)
async def judgment_uri_lock_get(
response: Response,
judgmentUri: str,
judgmentUri: DocumentURIString,
token_basic: TokenModel = Security(get_token_basic),
):
client = client_for_basic_auth(token_basic)
Expand Down Expand Up @@ -81,7 +83,7 @@ async def judgment_uri_lock_get(
)
async def judgment_uri_lock_put(
response: Response,
judgmentUri: str,
judgmentUri: DocumentURIString,
token_basic: TokenModel = Security(get_token_basic),
expires="0",
):
Expand Down Expand Up @@ -112,7 +114,7 @@ async def judgment_uri_lock_put(
)
async def judgment_uri_lock_delete(
response: Response,
judgmentUri: str,
judgmentUri: DocumentURIString,
token_basic: TokenModel = Security(get_token_basic),
):
client = client_for_basic_auth(token_basic)
Expand Down Expand Up @@ -146,7 +148,7 @@ async def judgment_uri_lock_delete(
async def judgment_uri_patch(
request: Request,
response: Response,
judgmentUri: str,
judgmentUri: DocumentURIString,
if_match: str = Header(
None, description="The last known version number of the document"
),
Expand Down

0 comments on commit 35b3b9c

Please sign in to comment.