Skip to content

Commit 0f58627

Browse files
committed
@sanderegg review: Literal
1 parent 7fe3693 commit 0f58627

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/models-library/src/models_library/api_schemas_catalog/services_ports.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
update_schema_doc,
1111
)
1212

13-
PortKindStr = Literal["input", "output"]
14-
1513

1614
class ServicePortGet(BaseModel):
1715
key: str = Field(
@@ -20,7 +18,7 @@ class ServicePortGet(BaseModel):
2018
pattern=PUBLIC_VARIABLE_NAME_RE,
2119
title="Key name",
2220
)
23-
kind: PortKindStr
21+
kind: Literal["input", "output"]
2422
content_media_type: str | None = None
2523
content_schema: dict[str, Any] | None = Field(
2624
None,
@@ -58,7 +56,7 @@ class ServicePortGet(BaseModel):
5856
@classmethod
5957
def from_domain_model(
6058
cls,
61-
kind: PortKindStr,
59+
kind: Literal["input", "output"],
6260
key: str,
6361
port: ServiceInput | ServiceOutput,
6462
) -> "ServicePortGet":

0 commit comments

Comments
 (0)