Revert "feat(nodes): make fields that accept connection input optional in OpenAPI schema"

This reverts commit 7325cbdd250153f347e3782265dd42783f7f1d00.
This commit is contained in:
psychedelicious 2023-08-20 22:24:42 +10:00
parent 6d111aac90
commit d95773f50f

View File

@ -464,16 +464,6 @@ class BaseInvocation(ABC, BaseModel):
schema["required"] = list()
schema["required"].extend(["type", "id"])
# nodes may have required fields, that can accept input from connections
# mark them as optional in the schema
for field_name, field in model_class.__fields__.items():
_input = field.field_info.extra.get("input", None)
if _input in [Input.Connection, Input.Any]:
try:
schema["required"].remove(field_name)
except Exception:
pass
@abstractmethod
def invoke(self, context: InvocationContext) -> BaseInvocationOutput:
"""Invoke with provided context and return outputs."""