🔧 chore(component.py): add Optional type hint to the 'code' field in the Component model to indicate that it is an optional field

🔧 chore(component.py): update the error message in the validate_entrypoint_name function to provide more clarity on the required field
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-07-26 07:43:49 -03:00
commit 57dd75b3f5

View file

@ -1,4 +1,5 @@
import ast
from typing import Optional
from pydantic import BaseModel
from fastapi import HTTPException
@ -20,7 +21,7 @@ class Component(BaseModel):
"The name of the entrypoint function must be provided."
)
code: str
code: Optional[str]
function_entrypoint_name = "build"
field_config: dict = {}