-
Notifications
You must be signed in to change notification settings - Fork 1
refactor: preserve multi-line formatting in generated doc comments #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: preserve multi-line formatting in generated doc comments #3
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
65388d0 to
ce1c521
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Updates the ACP schema from v0.4.9 to v0.6.2, incorporating latest protocol changes and type definitions. Enhances code generation with smart nested type naming that applies multiple heuristics to create idiomatic Go type names while preventing collisions. Key improvements: - Implements word-boundary deduplication for nested types - Strips RPC suffixes (Request/Response/Notification) when generating nested type names for cleaner identifiers - Adds defensive programming with panic-based collision detection to catch codegen bugs early - Generates proper nested structs for inline object properties Breaking changes: - Renames ToolCallUpdate to RequestPermissionToolCall in permission request contexts for schema consistency - Renames SessionUpdateToolCallUpdate to SessionToolCallUpdate - Changes EmbeddedResource.Resource field to direct EmbeddedResourceResource type
Adds discriminator properties to ContentBlock, MCPServerConfig, RequestPermissionOutcome, SessionUpdate, and ToolCallContent for improved type discrimination in the JSON schema. Updates ContentBlockText description to clarify Markdown support, indicating that clients SHOULD render text as Markdown.
Replace SanitizeComment with FormatDocComment to maintain the original structure of JSON schema descriptions. The new approach preserves paragraph breaks and line-by-line formatting instead of collapsing multi-line descriptions into single lines. Added emitDocComment and appendDocComments helper functions to standardize doc comment emission across the code generator. Deprecated SanitizeComment in favor of the new formatting function. This improves readability of generated API documentation by maintaining the intended structure of schema descriptions.
ce1c521 to
c86d96e
Compare
Adds support for JSON Schema discriminator metadata to improve generated union field names. The generator now: 1. Reads discriminator.propertyName from the schema 2. Uses discriminator const values as primary source for field names 3. Falls back to title or type name if discriminator is unavailable 4. Produces more ergonomic names like "Stdio" instead of "McpServerStdio" This change makes the generated API more idiomatic and easier to use while maintaining backward compatibility through the fallback chain. The discriminator-aware naming produces cleaner field names that match user expectations based on the schema's semantic intent.
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Changes extension types from defined types to type aliases (`type Foo = json.RawMessage` instead of `type Foo json.RawMessage`). The defined type approach created distinct types that did not inherit json.RawMessage's MarshalJSON and UnmarshalJSON methods, breaking JSON serialization. Type aliases preserve these critical methods while maintaining the intended extensibility semantics. Affects: AgentExtNotification, AgentExtMethodRequest, AgentExtMethodResponse, ClientExtNotification, ClientExtMethodRequest, ClientExtMethodResponse.
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Replace SanitizeComment with FormatDocComment to maintain the original structure of JSON schema descriptions.
The new approach preserves paragraph breaks and line-by-line formatting instead of collapsing multi-line descriptions into single lines.
Added emitDocComment and appendDocComments helper functions to standardize doc comment emission across the code generator.
Deprecated SanitizeComment in favor of the new formatting function.
This improves the readability of the generated API documentation by maintaining the intended structure of schema descriptions.