microsoft / microsoft/typespec

[Bug]: http-server-csharp: tsp compile fails with error: Visibility of property 'name' is sealed and cannot be changed.

Open
#11,452 1 comment 1 reaction 0 assignees View on GitHub
bug emitter:service:csharp triaged:core
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
1d 23h
Merged PRs (30d)
104

Description

### Describe the bug

Full error message:

```
node_modules/@azure-tools/typespec-azure-resource-manager/lib/models.tsp:88:1 - error visibility-sealed: Visibility of property 'name' is sealed and cannot be changed.
> 88 | @armResourceInternal(Properties)
```

### Reproduction

1. Use an ARM RP typespec
2. Add the following to tspconfig.yaml

```yml
emit:
- "@typespec/http-server-csharp"
options:
"@typespec/http-server-csharp":
emitter-output-dir: "{project-root}/generated/{emitter-name}"
output-type: all
emit-mocks: none
overwrite: true
```

### Checklist

- [x] Follow our [Code of Conduct](https://github.com/microsoft/typespec/blob/main/CODE_OF_CONDUCT.md)
- [x] Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- [x] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/Microsoft/typespec/discussions).
- [x] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with an ARM RP TypeSpec project using the tspconfig.yaml emitter configuration shown, then inspect the @typespec/http-server-csharp emitter and the referenced @azure-tools/typespec-azure-resource-manager/lib/models.tsp location. Done means the configuration compiles without the visibility-sealed error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.