Bump versions for release 0.55.0 - april 2024 (#3096)

This commit is contained in:
Timothee Guerin 2024-04-02 14:55:47 -07:00 коммит произвёл GitHub
Родитель 63cb176500
Коммит 2f53533d94
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
180 изменённых файлов: 576 добавлений и 548 удалений

Просмотреть файл

@ -1,8 +0,0 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: fix
packages:
- "@typespec/playground"
---
Add `aria` attributes for accessibility

Просмотреть файл

@ -1,8 +0,0 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: feature
packages:
- "@typespec/compiler"
---
Enable the use of `@encode` for model properties that have a union type. This supports cases like `@encode("rfc3339") prop: utcDateTime | null`

Просмотреть файл

@ -1,15 +0,0 @@
---
changeKind: deprecation
packages:
- "@typespec/compiler"
---
Deprecate `@knownValues` decorator. Use a named union of string literal with a string variant to achieve the same result without a decorator
Example:
```diff
-enum FooKV { a, b, c}
-@knownValues(FooKV)
-scalar foo extends string;
+union Foo { "a", "b", "c", string }
```

Просмотреть файл

@ -1,6 +0,0 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: internal
packages:
- "@typespec/openapi3"
---

Просмотреть файл

@ -1,14 +0,0 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: deprecation
packages:
- "@typespec/compiler"
---
Deprecate `@projectedName` decorator. `@encodedName` should be used instead.
Example:
```diff
-@projectedName("json", "exp")
+@encodedName("application/json", "exp")
```

Просмотреть файл

@ -1,6 +0,0 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: internal
packages:
- "@typespec/openapi3"
---

Просмотреть файл

@ -1,14 +0,0 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: internal
packages:
- "@typespec/compiler"
- "@typespec/openapi"
- "@typespec/openapi3"
- "@typespec/json-schema"
- "@typespec/protobuf"
- "@typespec/versioning"
- "@typespec/rest"
- "@typespec/http"
---
Align TS decorators implementation types with the TypeSpec signature

Просмотреть файл

@ -1,8 +0,0 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: fix
packages:
- "@typespec/eslint-config-typespec"
---
Ignore `generated-defs` folder

Просмотреть файл

@ -1,8 +0,0 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: fix
packages:
- "@typespec/compiler"
---
Grammar: Fix comments in template params not tokenized

Просмотреть файл

@ -1,8 +0,0 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: fix
packages:
- "@typespec/openapi3"
---
Do not crash if using an unsupported intrinsic type

Просмотреть файл

@ -1,8 +0,0 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: internal
packages:
- "@typespec/openapi3"
---
OpenAPI3: Fix multipart union part conflict

Просмотреть файл

@ -1,8 +0,0 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: fix
packages:
- "@typespec/openapi3"
---
Fix crash: emit `{nullable: true}` when trying to emit `null` in openapi3

Просмотреть файл

@ -1,8 +0,0 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: fix
packages:
- "@typespec/openapi3"
---
Fix: OpenAPI3 not marking part of bytes or something else as `format: binary`

Просмотреть файл

@ -1,6 +0,0 @@
---
changeKind: internal
packages:
- "@typespec/playground"
---

Просмотреть файл

@ -1,7 +0,0 @@
---
changeKind: fix
packages:
- "@typespec/openapi3"
---
Fix: Literal unions with the same variants keep adding duplicate entries

Просмотреть файл

@ -1,8 +0,0 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: fix
packages:
- "@typespec/compiler"
---
Fix: Union template declaration were incorrectly being finished in projection

Просмотреть файл

@ -1,8 +0,0 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: fix
packages:
- "@typespec/openapi3"
---
Fix visibility naming conflict when a model used with `extends` was used in different visibility.

Просмотреть файл

@ -1,8 +0,0 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: fix
packages:
- "@typespec/compiler"
---
Warnings converted to error with `warn-as-error` do not prevent compilation from moving to the next stage like regular warnings

Просмотреть файл

@ -1,8 +0,0 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: fix
packages:
- "@typespec/compiler"
---
Improve relability of application of codefixes in IDE, often it would not do anything

Просмотреть файл

@ -1,24 +0,0 @@
---
changeKind: internal
packages:
- "@typespec/bundler"
- "@typespec/compiler"
- "@typespec/eslint-config-typespec"
- "@typespec/eslint-plugin"
- "@typespec/html-program-viewer"
- "@typespec/http"
- "@typespec/internal-build-utils"
- "@typespec/json-schema"
- "@typespec/library-linter"
- "@typespec/openapi"
- "@typespec/openapi3"
- "@typespec/playground"
- "@typespec/prettier-plugin-typespec"
- "@typespec/protobuf"
- "@typespec/rest"
- tmlanguage-generator
- typespec-vscode
- "@typespec/versioning"
---
Dep update

Просмотреть файл

@ -1,7 +0,0 @@
---
changeKind: feature
packages:
- "@typespec/versioning"
---
Add support for versioning of scalars(Added, removed, renamed)

Просмотреть файл

@ -1,7 +0,0 @@
---
changeKind: feature
packages:
- "@typespec/compiler"
---
Experimental projection: Add support for scalars

Просмотреть файл

@ -1,7 +0,0 @@
---
changeKind: internal
packages:
- "@typespec/playground"
---
Change swagger ui dependency

Просмотреть файл

@ -1,8 +0,0 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: fix
packages:
- "@typespec/compiler"
---
TmLanguage: Fix tokenization of escaped identifiers, enums and unions

Просмотреть файл

@ -1,25 +0,0 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: dependencies
packages:
- "@typespec/bundler"
- "@typespec/compiler"
- "@typespec/eslint-config-typespec"
- "@typespec/eslint-plugin"
- "@typespec/html-program-viewer"
- "@typespec/http"
- "@typespec/internal-build-utils"
- "@typespec/json-schema"
- "@typespec/library-linter"
- "@typespec/openapi"
- "@typespec/openapi3"
- "@typespec/playground"
- "@typespec/prettier-plugin-typespec"
- "@typespec/protobuf"
- "@typespec/rest"
- tmlanguage-generator
- typespec-vscode
- "@typespec/versioning"
---
Update dependencies

Просмотреть файл

@ -1,6 +0,0 @@
---
changeKind: internal
packages:
- "@typespec/openapi"
---

Просмотреть файл

@ -1,8 +0,0 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: internal
packages:
- "@typespec/compiler"
- "@typespec/http"
- "@typespec/openapi3"
---

Просмотреть файл

@ -1,5 +1,12 @@
# Change Log - @typespec/bundler
## 0.1.2
### Bump dependencies
- [#3027](https://github.com/microsoft/typespec/pull/3027) Update dependencies
## 0.1.1
### Bump dependencies

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@typespec/bundler",
"version": "0.1.1",
"version": "0.1.2",
"author": "Microsoft Corporation",
"description": "Package to bundle a TypeSpec library.",
"homepage": "https://typespec.io",

Просмотреть файл

@ -1,5 +1,44 @@
# Change Log - @typespec/compiler
## 0.55.0
### Bug Fixes
- [#3018](https://github.com/microsoft/typespec/pull/3018) Grammar: Fix comments in template params not tokenized
- [#3052](https://github.com/microsoft/typespec/pull/3052) Fix: Union template declaration were incorrectly being finished in projection
- [#2983](https://github.com/microsoft/typespec/pull/2983) Warnings converted to error with `warn-as-error` do not prevent compilation from moving to the next stage like regular warnings
- [#3041](https://github.com/microsoft/typespec/pull/3041) Improve relability of application of codefixes in IDE, often it would not do anything
- [#3069](https://github.com/microsoft/typespec/pull/3069) TmLanguage: Fix tokenization of escaped identifiers, enums and unions
### Bump dependencies
- [#3027](https://github.com/microsoft/typespec/pull/3027) Update dependencies
### Features
- [#2992](https://github.com/microsoft/typespec/pull/2992) Enable the use of `@encode` for model properties that have a union type. This supports cases like `@encode("rfc3339") prop: utcDateTime | null`
- [#3053](https://github.com/microsoft/typespec/pull/3053) Experimental projection: Add support for scalars
### Deprecations
- [#3094](https://github.com/microsoft/typespec/pull/3094) Deprecate `@knownValues` decorator. Use a named union of string literal with a string variant to achieve the same result without a decorator
Example:
```diff
-enum FooKV { a, b, c}
-@knownValues(FooKV)
-scalar foo extends string;
+union Foo { "a", "b", "c", string }
```
- [#2910](https://github.com/microsoft/typespec/pull/2910) Deprecate `@projectedName` decorator. `@encodedName` should be used instead.
Example:
```diff
-@projectedName("json", "exp")
+@encodedName("application/json", "exp")
```
## 0.54.0
### Bug Fixes

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@typespec/compiler",
"version": "0.54.0",
"version": "0.55.0",
"description": "TypeSpec Compiler Preview",
"author": "Microsoft Corporation",
"license": "MIT",

Просмотреть файл

@ -3,12 +3,12 @@
"title": "Empty project",
"description": "Create an empty project.",
"libraries": [],
"compilerVersion": "0.54.0"
"compilerVersion": "0.55.0"
},
"rest": {
"title": "Generic REST API",
"description": "Create a project representing a generic REST API",
"compilerVersion": "0.54.0",
"compilerVersion": "0.55.0",
"libraries": [
"@typespec/http",
"@typespec/rest",
@ -23,7 +23,7 @@
"library-ts": {
"title": "TypeSpec Library (With TypeScript)",
"description": "Create a new package to add decorators or linters to typespec.",
"compilerVersion": "0.54.0",
"compilerVersion": "0.55.0",
"libraries": [],
"files": [
{
@ -99,7 +99,7 @@
"emitter-ts": {
"title": "TypeSpec Emitter (With TypeScript)",
"description": "Create a new package that will be emitting typespec",
"compilerVersion": "0.54.0",
"compilerVersion": "0.55.0",
"libraries": [],
"files": [
{

Просмотреть файл

@ -1,5 +1,16 @@
# Change Log - @typespec/eslint-config-typespec
## 0.55.0
### Bug Fixes
- [#2122](https://github.com/microsoft/typespec/pull/2122) Ignore `generated-defs` folder
### Bump dependencies
- [#3027](https://github.com/microsoft/typespec/pull/3027) Update dependencies
## 0.54.0
### Bug Fixes

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@typespec/eslint-config-typespec",
"version": "0.54.0",
"version": "0.55.0",
"description": "ESLint config for TypeSpec packages",
"main": "index.js",
"repository": {

Просмотреть файл

@ -1,5 +1,12 @@
# Change Log - @typespec/eslint-plugin
## 0.55.0
### Bump dependencies
- [#3027](https://github.com/microsoft/typespec/pull/3027) Update dependencies
## 0.54.0
### Bump dependencies

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@typespec/eslint-plugin",
"version": "0.54.0",
"version": "0.55.0",
"author": "Microsoft Corporation",
"description": "Eslint plugin providing set of rules to be used in the JS/TS code of TypeSpec libraries",
"homepage": "https://typespec.io",

Просмотреть файл

@ -1,5 +1,12 @@
# Change Log - @typespec/html-program-viewer
## 0.55.0
### Bump dependencies
- [#3027](https://github.com/microsoft/typespec/pull/3027) Update dependencies
## 0.54.0
### Bug Fixes

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@typespec/html-program-viewer",
"version": "0.54.0",
"version": "0.55.0",
"author": "Microsoft Corporation",
"description": "TypeSpec library for emitting an html view of the program.",
"homepage": "https://typespec.io",

Просмотреть файл

@ -1,5 +1,12 @@
# Change Log - @typespec/http
## 0.55.0
### Bump dependencies
- [#3027](https://github.com/microsoft/typespec/pull/3027) Update dependencies
## 0.54.0
### Bug Fixes

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@typespec/http",
"version": "0.54.0",
"version": "0.55.0",
"author": "Microsoft Corporation",
"description": "TypeSpec HTTP protocol binding",
"homepage": "https://github.com/microsoft/typespec",

Просмотреть файл

@ -1,5 +1,12 @@
# Change Log - @typespec/internal-build-utils
## 0.55.0
### Bump dependencies
- [#3027](https://github.com/microsoft/typespec/pull/3027) Update dependencies
## 0.54.0
### Bug Fixes

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@typespec/internal-build-utils",
"version": "0.54.0",
"version": "0.55.0",
"author": "Microsoft Corporation",
"description": "Internal library to TypeSpec providing helpers to build.",
"homepage": "https://typespec.io",

Просмотреть файл

@ -1,5 +1,12 @@
# Change Log - @typespec/json-schema
## 0.55.0
### Bump dependencies
- [#3027](https://github.com/microsoft/typespec/pull/3027) Update dependencies
## 0.54.0
### Bug Fixes

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@typespec/json-schema",
"version": "0.54.0",
"version": "0.55.0",
"author": "Microsoft Corporation",
"description": "TypeSpec library for emitting TypeSpec to JSON Schema and converting JSON Schema to TypeSpec",
"homepage": "https://github.com/microsoft/typespec",

Просмотреть файл

@ -1,5 +1,12 @@
# Change Log - @typespec/library-linter
## 0.55.0
### Bump dependencies
- [#3027](https://github.com/microsoft/typespec/pull/3027) Update dependencies
## 0.54.0
### Bump dependencies

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@typespec/library-linter",
"version": "0.54.0",
"version": "0.55.0",
"author": "Microsoft Corporation",
"description": "TypeSpec library for linting another library.",
"homepage": "https://typespec.io",

Просмотреть файл

@ -1,5 +1,12 @@
# Change Log - @typespec/openapi
## 0.55.0
### Bump dependencies
- [#3027](https://github.com/microsoft/typespec/pull/3027) Update dependencies
## 0.54.0
### Bump dependencies

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@typespec/openapi",
"version": "0.54.0",
"version": "0.55.0",
"author": "Microsoft Corporation",
"description": "TypeSpec library providing OpenAPI concepts",
"homepage": "https://typespec.io",

Просмотреть файл

@ -1,5 +1,20 @@
# Change Log - @typespec/openapi3
## 0.55.0
### Bug Fixes
- [#3077](https://github.com/microsoft/typespec/pull/3077) Do not crash if using an unsupported intrinsic type
- [#2967](https://github.com/microsoft/typespec/pull/2967) Fix crash: emit `{nullable: true}` when trying to emit `null` in openapi3
- [#3013](https://github.com/microsoft/typespec/pull/3013) Fix: OpenAPI3 not marking part of bytes or something else as `format: binary`
- [#3090](https://github.com/microsoft/typespec/pull/3090) Fix: Literal unions with the same variants keep adding duplicate entries
- [#3049](https://github.com/microsoft/typespec/pull/3049) Fix visibility naming conflict when a model used with `extends` was used in different visibility.
### Bump dependencies
- [#3027](https://github.com/microsoft/typespec/pull/3027) Update dependencies
## 0.54.0
### Bump dependencies

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@typespec/openapi3",
"version": "0.54.0",
"version": "0.55.0",
"author": "Microsoft Corporation",
"description": "TypeSpec library for emitting OpenAPI 3.0 from the TypeSpec REST protocol binding",
"homepage": "https://typespec.io",

Просмотреть файл

@ -1,5 +1,16 @@
# Change Log - @typespec/playground
## 0.2.1
### Bug Fixes
- [#3031](https://github.com/microsoft/typespec/pull/3031) Add `aria` attributes for accessibility
### Bump dependencies
- [#3027](https://github.com/microsoft/typespec/pull/3027) Update dependencies
## 0.2.0
### Bug Fixes

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@typespec/playground",
"version": "0.2.0",
"version": "0.2.1",
"author": "Microsoft Corporation",
"description": "TypeSpec playground UI components.",
"homepage": "https://typespec.io",

Просмотреть файл

@ -1,5 +1,12 @@
# Change Log - @typespec/prettier-plugin-typespec
## 0.55.0
### Bump dependencies
- [#3027](https://github.com/microsoft/typespec/pull/3027) Update dependencies
## 0.54.0
### Bump dependencies

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@typespec/prettier-plugin-typespec",
"version": "0.54.0",
"version": "0.55.0",
"description": "",
"main": "dist/index.js",
"scripts": {

Просмотреть файл

@ -1,5 +1,12 @@
# Change Log - @typespec/protobuf
## 0.55.0
### Bump dependencies
- [#3027](https://github.com/microsoft/typespec/pull/3027) Update dependencies
## 0.54.0
### Bump dependencies

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@typespec/protobuf",
"version": "0.54.0",
"version": "0.55.0",
"author": "Microsoft Corporation",
"description": "TypeSpec library and emitter for Protobuf (gRPC)",
"homepage": "https://github.com/microsoft/typespec",

Просмотреть файл

@ -1,5 +1,12 @@
# Change Log - @typespec/rest
## 0.55.0
### Bump dependencies
- [#3027](https://github.com/microsoft/typespec/pull/3027) Update dependencies
## 0.54.0
### Bump dependencies

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@typespec/rest",
"version": "0.54.0",
"version": "0.55.0",
"author": "Microsoft Corporation",
"description": "TypeSpec REST protocol binding",
"homepage": "https://typespec.io",

Просмотреть файл

@ -1,5 +1,12 @@
# Change Log - tmlanguage-generator
## 0.5.4
### Bump dependencies
- [#3027](https://github.com/microsoft/typespec/pull/3027) Update dependencies
## 0.5.3
### Bump dependencies

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "tmlanguage-generator",
"version": "0.5.3",
"version": "0.5.4",
"author": "Microsoft Corporation",
"description": "Helper library to generate TextMate syntax highlighting tmLanguage files.",
"homepage": "https://github.com/microsoft/typespec/tree/main/packages/tmlanguage-generator",

Просмотреть файл

@ -1,5 +1,9 @@
# Change Log - typespec-vs
## 0.55.0
No changes, version bump only.
## 0.54.0
### Bump dependencies

Просмотреть файл

@ -1,7 +1,7 @@
{
"name": "typespec-vs",
"author": "Microsoft Corporation",
"version": "0.54.0",
"version": "0.55.0",
"description": "TypeSpec Language Support for Visual Studio",
"homepage": "https://typespec.io",
"readme": "https://github.com/microsoft/typespec/blob/main/README.md",

Просмотреть файл

@ -1,5 +1,12 @@
# Change Log - typespec-vscode
## 0.55.0
### Bump dependencies
- [#3027](https://github.com/microsoft/typespec/pull/3027) Update dependencies
## 0.54.0
### Bump dependencies

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "typespec-vscode",
"version": "0.54.1",
"version": "0.55.0",
"author": "Microsoft Corporation",
"description": "TypeSpec language support for VS Code",
"homepage": "https://typespec.io",

Просмотреть файл

@ -1,5 +1,16 @@
# Change Log - @typespec/versioning
## 0.55.0
### Bump dependencies
- [#3027](https://github.com/microsoft/typespec/pull/3027) Update dependencies
### Features
- [#3053](https://github.com/microsoft/typespec/pull/3053) Add support for versioning of scalars(Added, removed, renamed)
## 0.54.0
### Bump dependencies

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@typespec/versioning",
"version": "0.54.0",
"version": "0.55.0",
"author": "Microsoft Corporation",
"description": "TypeSpec library for declaring and emitting versioned APIs",
"homepage": "https://typespec.io",

Просмотреть файл

@ -1,4 +1,5 @@
[
"0.55.x",
"0.54.x",
"0.53.x",
"0.52.x",

Просмотреть файл

@ -238,9 +238,7 @@ The first step is to define how your library can be loaded from the test framewo
1. Create a new file `./src/testing/index.ts` with the following content
```ts
import { resolvePath } from "@typespec/compiler";
import { createTestLibrary } from "@typespec/compiler/testing";
import { fileURLToPath } from "url";
import { createTestLibrary, findTestPackageRoot } from "@typespec/compiler/testing";
export const MyTestLibrary = createTestLibrary({
name: "<name-of-npm-pkg>",
@ -279,7 +277,7 @@ Create a new file `test/test-host.js` (change `test` to be your test folder)
```ts
import { createTestHost, createTestWrapper } from "@typespec/compiler/testing";
import { RestTestLibrary } from "/rest/testing";
import { RestTestLibrary } from "@typespec/rest/testing";
import { MyTestLibrary } from "../src/testing/index.js";
export async function createMyTestHost() {

Просмотреть файл

@ -1,13 +1,13 @@
---
id: create-decorators
title: How to create TypeSpec decorators
title: Decorators
---
# How to create TypeSpec decorators
# Decorators
TypeSpec decorators are implemented as JavaScript functions. The process of creating a decorator can be divided into two parts:
1. [(Optional) Declare the decorator signature in TypeSpec](#declare-the-decorator-signature)
1. [Declare the decorator signature in TypeSpec](#declare-the-decorator-signature) (optional but recommended)
2. [Implement the decorator in JavaScript](#implement-the-decorator-in-javascript)
## Declare the decorator signature

Просмотреть файл

@ -7,6 +7,14 @@ title: Emitters
TypeSpec emitters are libraries that utilize various TypeSpec compiler APIs to reflect on the TypeSpec compilation process and generate artifacts. The TypeSpec standard library includes an emitter for OpenAPI version 3.0. However, you might want to emit TypeSpec to a different output format. One of the main advantages of TypeSpec is its ease of use as a single source of truth for all data shapes, and the simplicity of creating an emitter contributes significantly to this.
## Emitter design
TypeSpec is designed to support many protocols and many output formats. It is important that an emitter is designed to select only the part of the TypeSpec spec that makes sense for them. Having emitters designed correctly will allow a user to define multiple layers of their API in a single TypeSpec document, allowing tools to view the entire picture of the service.
For example assuming a User wants to emit `openapi3` and `protobuf` but each API has a different set of operations and is split into different namespaces.
It is important that there is a way for the openapi3 emitter and protobuf emitter to select only the part of the spec that applies to them. For instance, the protobuf emitter should not try to emit the http service namespace and fail because of missing annotations.
## Starting out
TypeSpec emitters are a unique type of TypeSpec library, so they follow the same initial setup instructions.

Просмотреть файл

@ -1,9 +1,9 @@
---
id: linters
title: Understanding linters
title: Linters
---
# Understanding linters
# Linters
## Linter versus `onValidate`
@ -78,8 +78,8 @@ context.reportDiagnostic({
codefixes: [
defineCodeFix({
id: "add-model-suffix",
description: "Add 'Model' suffix to model name",
apply: (program) => {
label: "Add 'Model' suffix to model name",
fix: (program) => {
program.update(model, {
name: `${model.name}Model`,
});

Двоичные данные
packages/website/versioned_docs/version-latest/images/vscode.gif Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.6 MiB

Просмотреть файл

@ -54,12 +54,19 @@ op create(@header contentType: "multipart/form-data", images: bytes[]): void;
// Upload 2 form fields
op create(@header contentType: "multipart/form-data", firstName: string, lastName: string): void;
// Upload a json field
// Send a json field
model Address {
street: string;
city: string;
}
op create(@header contentType: "multipart/form-data", address: Address): void;
// Send multiple fields - In this scenario each address is sent as an individual part
model Address {
street: string;
city: string;
}
op create(@header contentType: "multipart/form-data", addresses: Address[]): void;
```
## Custom Content-Type, boundary, etc.

Просмотреть файл

@ -4,7 +4,7 @@ title: "[F] $body"
---
```ts
$body(context, entity): void
$body(context, target): void
```
## Parameters
@ -12,7 +12,7 @@ $body(context, entity): void
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `entity` | `ModelProperty` |
| `target` | `ModelProperty` |
## Returns

Просмотреть файл

@ -4,7 +4,7 @@ title: "[F] $delete"
---
```ts
$delete(context, entity): void
$delete(context, target): void
```
## Parameters
@ -12,7 +12,7 @@ $delete(context, entity): void
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `entity` | `Operation` |
| `target` | `Operation` |
## Returns

Просмотреть файл

@ -4,7 +4,7 @@ title: "[F] $get"
---
```ts
$get(context, entity): void
$get(context, target): void
```
## Parameters
@ -12,7 +12,7 @@ $get(context, entity): void
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `entity` | `Operation` |
| `target` | `Operation` |
## Returns

Просмотреть файл

@ -4,7 +4,7 @@ title: "[F] $head"
---
```ts
$head(context, entity): void
$head(context, target): void
```
## Parameters
@ -12,7 +12,7 @@ $head(context, entity): void
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `entity` | `Operation` |
| `target` | `Operation` |
## Returns

Просмотреть файл

@ -6,7 +6,7 @@ title: "[F] $header"
```ts
$header(
context,
entity,
target,
headerNameOrOptions?): void
```
@ -15,8 +15,8 @@ $header(
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `entity` | `ModelProperty` |
| `headerNameOrOptions`? | `StringLiteral` \| `Model` |
| `target` | `ModelProperty` |
| `headerNameOrOptions`? | `Type` |
## Returns

Просмотреть файл

@ -4,7 +4,7 @@ title: "[F] $patch"
---
```ts
$patch(context, entity): void
$patch(context, target): void
```
## Parameters
@ -12,7 +12,7 @@ $patch(context, entity): void
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `entity` | `Operation` |
| `target` | `Operation` |
## Returns

Просмотреть файл

@ -6,7 +6,7 @@ title: "[F] $path"
```ts
$path(
context,
entity,
target,
paramName?): void
```
@ -15,7 +15,7 @@ $path(
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `entity` | `ModelProperty` |
| `target` | `ModelProperty` |
| `paramName`? | `string` |
## Returns

Просмотреть файл

@ -4,7 +4,7 @@ title: "[F] $plainData"
---
```ts
$plainData(context, entity): void
$plainData(context, target): void
```
## Parameters
@ -12,7 +12,7 @@ $plainData(context, entity): void
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `entity` | `Model` |
| `target` | `Model` |
## Returns

Просмотреть файл

@ -4,7 +4,7 @@ title: "[F] $post"
---
```ts
$post(context, entity): void
$post(context, target): void
```
## Parameters
@ -12,7 +12,7 @@ $post(context, entity): void
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `entity` | `Operation` |
| `target` | `Operation` |
## Returns

Просмотреть файл

@ -4,7 +4,7 @@ title: "[F] $put"
---
```ts
$put(context, entity): void
$put(context, target): void
```
## Parameters
@ -12,7 +12,7 @@ $put(context, entity): void
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `entity` | `Operation` |
| `target` | `Operation` |
## Returns

Просмотреть файл

@ -6,7 +6,7 @@ title: "[F] $query"
```ts
$query(
context,
entity,
target,
queryNameOrOptions?): void
```
@ -15,8 +15,8 @@ $query(
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `entity` | `ModelProperty` |
| `queryNameOrOptions`? | `StringLiteral` \| `Model` |
| `target` | `ModelProperty` |
| `queryNameOrOptions`? | `Type` |
## Returns

Просмотреть файл

@ -6,9 +6,9 @@ title: "[F] $route"
```ts
$route(
context,
entity,
target,
path,
parameters?): void
options?): void
```
`@route` defines the relative route URI for the target operation
@ -24,9 +24,9 @@ it will be used as a prefix to the route URI of the operation.
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `entity` | `Type` |
| `target` | `Interface` \| `Namespace` \| `Operation` |
| `path` | `string` |
| `parameters`? | `Model` |
| `options`? | `Type` |
## Returns

Просмотреть файл

@ -22,7 +22,7 @@ Configure the server url for the service.
| `target` | `Namespace` | Decorator target (must be a namespace) |
| `url` | `string` | - |
| `description` | `string` | Description for this server. |
| `parameters`? | `Model` | |
| `parameters`? | `Type` | |
## Returns

Просмотреть файл

@ -4,7 +4,7 @@ title: "[F] $sharedRoute"
---
```ts
$sharedRoute(context, entity): void
$sharedRoute(context, target): void
```
`@sharedRoute` marks the operation as sharing a route path with other operations.
@ -19,7 +19,7 @@ route path as long as those operations are also marked with `@sharedRoute`.
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `entity` | `Operation` |
| `target` | `Operation` |
## Returns

Просмотреть файл

@ -4,7 +4,7 @@ title: "[F] $statusCode"
---
```ts
$statusCode(context, entity): void
$statusCode(context, target): void
```
## Parameters
@ -12,7 +12,7 @@ $statusCode(context, entity): void
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `entity` | `ModelProperty` |
| `target` | `ModelProperty` |
## Returns

Просмотреть файл

@ -16,7 +16,7 @@ $useAuth(
| :------ | :------ |
| `context` | `DecoratorContext` |
| `entity` | `Interface` \| `Namespace` \| `Operation` |
| `authConfig` | `Model` \| `Tuple` \| `Union` |
| `authConfig` | `Type` |
## Returns

Просмотреть файл

@ -15,7 +15,7 @@ setStatusCode(
| Parameter | Type |
| :------ | :------ |
| `program` | `Program` |
| `entity` | `Model` \| `ModelProperty` |
| `entity` | `ModelProperty` \| `Model` |
| `codes` | `string`[] |
## Returns

Просмотреть файл

@ -53,7 +53,7 @@ private #applyConstraints(type, schema): void
| Parameter | Type |
| :------ | :------ |
| `type` | \| `Model` \| `ModelProperty` \| `Scalar` \| `Enum` \| `Union` |
| `type` | \| `Scalar` \| `ModelProperty` \| `Model` \| `Enum` \| `Union` |
| `schema` | `ObjectBuilder`<`unknown`\> |
#### Returns

Просмотреть файл

@ -15,7 +15,7 @@ $contains(
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `target` | `Model` \| `ModelProperty` |
| `target` | `Type` |
| `value` | `Type` |
## Returns

Просмотреть файл

@ -15,7 +15,7 @@ $contentEncoding(
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `target` | `StringLiteral` \| `ModelProperty` |
| `target` | `Scalar` \| `ModelProperty` |
| `value` | `string` |
## Returns

Просмотреть файл

@ -15,7 +15,7 @@ $contentMediaType(
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `target` | `StringLiteral` \| `ModelProperty` |
| `target` | `Scalar` \| `ModelProperty` |
| `value` | `string` |
## Returns

Просмотреть файл

@ -15,7 +15,7 @@ $contentSchema(
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `target` | `StringLiteral` \| `ModelProperty` |
| `target` | `Scalar` \| `ModelProperty` |
| `value` | `Type` |
## Returns

Просмотреть файл

@ -7,7 +7,7 @@ title: "[F] $id"
$id(
context,
target,
value): void
id): void
```
## Parameters
@ -15,8 +15,8 @@ $id(
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `target` | `Model` \| `Scalar` \| `Enum` \| `Union` |
| `value` | `string` |
| `target` | `Type` |
| `id` | `string` |
## Returns

Просмотреть файл

@ -7,7 +7,7 @@ title: "[F] $jsonSchema"
$jsonSchema(
context,
target,
baseUriOrId?): void
baseUri?): void
```
## Parameters
@ -15,8 +15,8 @@ $jsonSchema(
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `target` | `Namespace` \| [`JsonSchemaDeclaration`](../type-aliases/JsonSchemaDeclaration.md) |
| `baseUriOrId`? | `string` |
| `target` | `Type` |
| `baseUri`? | `string` |
## Returns

Просмотреть файл

@ -15,7 +15,7 @@ $maxContains(
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `target` | `Model` \| `ModelProperty` |
| `target` | `Type` |
| `value` | `number` |
## Returns

Просмотреть файл

@ -15,7 +15,7 @@ $maxProperties(
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `target` | `Model` \| `ModelProperty` |
| `target` | `Type` |
| `value` | `number` |
## Returns

Просмотреть файл

@ -15,7 +15,7 @@ $minContains(
| Parameter | Type |
| :------ | :------ |
| `context` | `DecoratorContext` |
| `target` | `Model` \| `ModelProperty` |
| `target` | `Type` |
| `value` | `number` |
## Returns

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше