Skip to content

descriptor: report missing extendee and method types by name - #808

Open
bniladridas wants to merge 1 commit into
anthropics:mainfrom
bniladridas:fix/missing-type-name-context
Open

bniladridas wants to merge 1 commit into
anthropics:mainfrom
bniladridas:fix/missing-type-name-context

Conversation

@bniladridas

Copy link
Copy Markdown
Contributor

Summary

Clarify PoolError diagnostics for missing descriptor type references.

  • Keep MissingTypeName { field } and its existing message for fields.
  • Add MissingExtendee { extension } for extensions without an extendee.
  • Add MissingMethodInputType { method } and MissingMethodOutputType { method } for methods missing their input or output type.
  • Add end-to-end tests that verify each error variant, payload, and display message.

This changes which PoolError variant is returned for missing extension and method attributes. Field behavior remains unchanged.

InvalidJsonName and MalformedMapEntry are unchanged. The JSON-name work remains covered by #756.

Validation

  • cargo fmt --all -- --check
  • cargo test -p buffa-descriptor --features reflect
  • cargo test -p buffa-descriptor --no-default-features --features json,reflect --test '*'
  • cargo clippy -p buffa-descriptor --features reflect --all-targets -- -D warnings
  • RUSTDOCFLAGS="-D warnings" cargo doc -p buffa-descriptor --features reflect --no-deps
  • git diff --check

All listed checks passed. The changelog fragment was checked manually; Changie was unavailable in the local environment.

Refs #641

`PoolError::MissingTypeName` is emitted for a field with no `type_name`, but also for an extension with no `extendee` and a method with no `input_type` or `output_type`, so its message reports those declarations as fields and names neither the missing attribute nor the declaration kind.

Emit `MissingExtendee { extension }` for an extension without an extendee, and `MissingMethodInputType { method }` or `MissingMethodOutputType { method }` for a method missing its input or output type. `MissingTypeName { field }` keeps its shape and message and is now emitted only for fields. The new variants are additive on the non-exhaustive `PoolError` enum.

Refs anthropics#641

Signed-off-by: Niladri Das <125604915+bniladridas@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

This branch has not been deployed

No deployments
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