Skip to content

Let types carry their schema name and doc comment - #3

Merged
happyDemon merged 1 commit into
mainfrom
type-names-and-docs
Nov 10, 2026
Merged

happyDemon merged 1 commit into
mainfrom
type-names-and-docs

Conversation

@happyDemon

Copy link
Copy Markdown
Member

Why

A runtime Type only knows kinds, fields and variants. It has no idea what the schema calls a struct or enum, and no doc comments. The server's RPC Studio therefore has to invent record names (VerifySignInCodeResponse instead of SignInResult) and cannot show documentation.

What changes

All additions are optional, so existing calls and generated code keep working:

  • Type::struct() and Type::enum() take recordId (path/to/module.skir:Qualified.Name, the same identity upstream type descriptors use) and doc.
  • Field::value(), Variant::constant() and Variant::wrapper() take doc.
  • MethodDescriptor takes doc.

Serialization ignores all of it.

Follow-ups

The generators emit this metadata (@php-skir/generator-core and the three PHP generators), and php-skir/server uses it for the Studio method list.

Structs and enums take an optional record id
(`path/to/module.skir:Qualified.Name`) and doc, and fields, variants
and methods an optional doc. Serialization ignores them; they exist so
a server can describe its methods the way the schema does.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@happyDemon
happyDemon merged commit 45ea297 into main Nov 10, 2026
5 checks passed
@happyDemon
happyDemon deleted the type-names-and-docs branch November 10, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant