Azure / Azure/typespec-azure

[tcgc] how can we rename an options bag's name?

Open
#2,370 0 comments 0 reactions 0 assignees View on GitHub
design:needed lib:tcgc
Dominant language
TypeScript
Stars
27
Forks
90
Avg merge
1d 22h
Merged PRs (30d)
156

Description

```tsp
// By default, spread is spread: follow the TypeSpec blindly

// Make option bag generation the default for Java for the entire TypeSpec namespace.
// Use default strategy to pick up the name
@@optionBag(MyNamespace, "", "java")

// Use option bag for this operation, for rust. Generate name
@@optionBag(MyOperationn, "", "rust")

// Use option bag for this operation in Go, and name it explicitly
@@optionBag(MyOperation, "MyOperatitonOptions", "go")
```

Contributor guide

Open the contributing guide

Research direction

Start with the @optionBag examples in the issue and trace the TypeSpec compiler code that handles option-bag names for namespaces and operations. Determine the intended behavior for an explicitly supplied name versus the default strategy, then confirm the expected result across the Java, Rust, and Go examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.