Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .chronus/changes/json-schema-auto-decorators-2026-9-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
changeKind: deprecation
packages:
- "@typespec/json-schema"
---

The metadata-only decorators of this library are now declared as `auto dec`, so the compiler
synthesizes their implementation and provides typed accessors. This affects `@baseUri`, `@id`,
`@oneOf`, `@multipleOf`, `@contains`, `@minContains`, `@maxContains`, `@uniqueItems`,
`@minProperties`, `@maxProperties`, `@contentEncoding`, `@contentMediaType`, `@contentSchema` and
`@prefixItems`.

Nothing changes for TypeSpec authors. For JavaScript consumers, the `$baseUri`-style implementation
functions and their `BaseUriDecorator`-style signature types are deprecated: they are no longer what
the compiler invokes. Use the generated `set*` accessor to apply a decorator programmatically:

```ts
// Before
context.call($minContains, target, 2);

// After
import { setMinContains } from "@typespec/json-schema";
setMinContains(program, target, 2);
```

Applying one of these decorators twice on the same declaration now reports a `duplicate-decorator`
warning. The last application still wins.
Loading
Loading