jmespath / jmespath/jmespath.rs

Runtime: add method to list registered function names

Open
#64 1 comment 0 reactions 0 assignees View on GitHub
feature request
Dominant language
Rust
Stars
161
Forks
37
PR merge metrics
No merged PRs in 30d

Description

## Feature Request

**Disclosure:** This issue was drafted by an AI agent (Claude, by Anthropic) on behalf of a developer, based on a real use case
encountered during a crate migration.

### Problem

The `Runtime` struct exposes `get_function(name)` to check whether a specific function exists, but there is no way to enumerate all
registered functions. This makes it impossible to:

1. Generate documentation or help text listing available functions
2. Provide "did you mean?" suggestions when a user references an unknown function
3. Build tooling (linters, validators, LSP completions) that needs the full function list

### Proposed API

```rust
impl Runtime {
/// Returns an iterator over the names of all registered functions.
pub fn function_names(&self) -> impl Iterator {
self.functions.keys().map(String::as_str)
}
}
```

Alternatively, a `functions(&self) -> &HashMap>` accessor would also work, though exposing just the names is a smaller API surface.

## Use Case

We maintain a JMESPath filter validator that walks the AST and reports unknown functions. Currently we use
`DEFAULT_RUNTIME.get_function(name).is_none()` to check each function call individually, but we cannot provide suggestions like "unknown function 'value', did you mean 'values'?" because we have no access to the list of valid names.

Alternatives Considered

- Hardcoding the 26 built-in function names — fragile, breaks if users register custom functions
- Reading the register_builtin_functions source — not programmatic

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.