Skip to content

Commit 622c56f

Browse files
dgarrosclaude
andcommitted
feat(schema): expose kind as a property on write schema nodes [INFP-234]
Reading a locally-authored (write) schema needs `.kind` attribute access (e.g. the protocols CLI command). Expose `kind` as a plain property on the write node models — derived from namespace+name, like on read — but do not serialize it: on write it stays a property (not a `@computed_field`) so it never enters the payload, where `extra="forbid"` would reject it on the round-trip through the write/load contract. `hash` remains read-only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 71f3113 commit 622c56f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

infrahub_sdk/schema/generated/write.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,10 @@ class BaseNodeSchemaWrite(BaseModel):
506506
description="Node Relationships",
507507
)
508508

509+
@property
510+
def kind(self) -> str:
511+
return f"{self.namespace}{self.name}"
512+
509513

510514
class NodeSchemaWrite(BaseNodeSchemaWrite):
511515
model_config = ConfigDict(extra="forbid", use_enum_values=True)

0 commit comments

Comments
 (0)