File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 11from typing import Optional
22
3- from anystore .io import smart_read
3+ from anystore .io import DoesNotExist , smart_read
44from anystore .model import StoreModel
55from pydantic import BaseModel , HttpUrl
66from pydantic_settings import BaseSettings , SettingsConfigDict
@@ -40,6 +40,13 @@ class ApiContactSettings(BaseModel):
4040 email : str | None
4141
4242
43+ def get_api_doc () -> str :
44+ try :
45+ return smart_read ("./README.md" , "r" )
46+ except DoesNotExist :
47+ return ""
48+
49+
4350class ApiSettings (BaseSettings ):
4451 model_config = SettingsConfigDict (
4552 env_prefix = "leakrfc_api_" ,
@@ -52,7 +59,7 @@ class ApiSettings(BaseSettings):
5259 access_token_algorithm : str = "HS256"
5360
5461 title : str = "LeakRFC Api"
55- description : str = smart_read ( "./README.md" , mode = "r" )
62+ description : str = get_api_doc ( )
5663 contact : ApiContactSettings | None = None
5764
5865 allowed_origin : Optional [HttpUrl ] = "http://localhost:3000"
You can’t perform that action at this time.
0 commit comments