Fix XML wrapped primitives with custom names

Open
#951 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust
Domain
tooling

Research direction

Start by locating the XML serialization handling for wrapped primitive arrays and reproduce the TypeSpec example in the issue. The fix is done when a custom item name produces the ItemName tag instead of string, with coverage for the shown custom wrapper and item names.

Written by the indexing model from the issue text.

Description

CodeGen

At present, we use the wrong tag name for wrapped primitive types with custom names.

@name("ItemName")
scalar tag extends string;

/** §3.5 — Contains a wrapped primitive array with custom wrapper and item names. */
model ModelWithWrappedPrimitiveCustomItemNames {
  @name("ItemsTags")
  tags: tag[];
}

We use tag string instead of ItemName.

Dominant language
Rust
Stars
7
Forks
11
Avg merge
14h 15m
Merged PRs (30d)
6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/typespec-rust

All issues in Azure/typespec-rust

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.