streamlit-pydantic
streamlit-pydantic copied to clipboard
Optional field are set to value if input is not passed in json output
Optional field are set to value if input is not passed in json output.
Describe the bug:
This output of this code if opt_int is not set is the one reported in the picture
class ModelTest(BaseModel):
name: str = Field(title='Name')
opt_int: Optional[int] = Field(title='Optional int')
data = sp.pydantic_form(model=ModelTest, key="Data entry", group_optional_fields='expander')
st.text(data)
while the Expected behaviour: is a json containing only the user input {name='a'}