Skip to content
This repository was archived by the owner on Apr 30, 2025. It is now read-only.
This repository was archived by the owner on Apr 30, 2025. It is now read-only.

Bug: _UndefinedType is not JSON serializable #45

@skocan

Description

@skocan

Description

When frontend_default_value is not specified (should use a default value <not-defined> in that case), there is an error that _UndefinedType is not JSON serializable.

Example Code

Can be also achieved with something like this:

from typing import Any
from pydantic import BaseModel, Field
from frinx.common.workflow.workflow import UNDEFINED

class WorkflowInputField(BaseModel):
    name: str
    frontend_default_value: Any = Field(UNDEFINED, alias='value')


testing_input = WorkflowInputField(name="test")
print(testing_input.model_dump_json())

>> pydantic_core._pydantic_core.PydanticSerializationError: Unable to serialize unknown type: <class 'frinx.common.workflow.workflow._UndefinedType'>

Python, Poetry & Packages Version

Virtualenv
Python:         3.11.6
Valid:          True

System
Platform:   linux
OS:         posix
Python:     3.11.6

...
frinx-python-sdk       0 0706f8e     Python SDK for Frinx Machine Workflow Manager
frinx-uniconfig-api    0.1.0 ccfdf04 Python SDK for Frinx Machine Workflow Manager
frinx-uniconfig-worker 1.0.0 576057a Conductor worker for Frinx Uniconfig
...
Poetry (version 1.7.1)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions