Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/compiler",
"comment": "Added `Model` and `Scalar` to Reflection namespace",
"type": "none"
}
],
"packageName": "@typespec/compiler"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/openapi",
"comment": "Update decorator declaration to use `Model` instead of `object`",
"type": "none"
}
],
"packageName": "@typespec/openapi"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/openapi3",
"comment": "Update decorator declaration to use `Model` instead of `object`",
"type": "none"
}
],
"packageName": "@typespec/openapi3"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/rest",
"comment": "Update decorator declaration to use `Model` instead of `object`",
"type": "none"
}
],
"packageName": "@typespec/rest"
}
2 changes: 1 addition & 1 deletion docs/extending-typespec/create-decorators.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This part is optional but provides great value:
A decorator signature can be declared using the `dec` keyword. As we are implementing the decorator in JS (only choice right now), we must apply the `extern` modifier as well.

```typespec
extern dec logType(target: TypeSpec.Reflection.Type, name: TypeSpec.Reflection.StringLiteral);
extern dec logType(target: unknown, name: string);
```

## Decorator target
Expand Down
28 changes: 14 additions & 14 deletions docs/standard-library/built-in-decorators.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ dec deprecated(target: unknown, message: string)
Specify the property to be used to discriminate this type.

```typespec
dec discriminator(target: object | Union, propertyName: string)
dec discriminator(target: Model | Union, propertyName: string)
```

#### Target

`union object | Union`
`union Model | Union`

#### Parameters
| Name | Type | Description |
Expand Down Expand Up @@ -84,12 +84,12 @@ dec doc(target: unknown, doc: string, formatArgs?: object)
Specify that this model is an error type. Operations return error types when the operation has failed.

```typespec
dec error(target: object)
dec error(target: Model)
```

#### Target

`model object`
`Model`

#### Parameters
None
Expand Down Expand Up @@ -550,12 +550,12 @@ name: string;


```typespec
dec withDefaultKeyVisibility(target: object, visibility: unknown)
dec withDefaultKeyVisibility(target: Model, visibility: unknown)
```

#### Target

`model object`
`Model`

#### Parameters
| Name | Type | Description |
Expand All @@ -567,12 +567,12 @@ dec withDefaultKeyVisibility(target: object, visibility: unknown)


```typespec
dec withoutDefaultValues(target: object)
dec withoutDefaultValues(target: Model)
```

#### Target

`model object`
`Model`

#### Parameters
None
Expand All @@ -582,12 +582,12 @@ None


```typespec
dec withoutOmittedProperties(target: object, omit: string | Union)
dec withoutOmittedProperties(target: Model, omit: string | Union)
```

#### Target

`model object`
`Model`

#### Parameters
| Name | Type | Description |
Expand All @@ -599,12 +599,12 @@ dec withoutOmittedProperties(target: object, omit: string | Union)


```typespec
dec withUpdateableProperties(target: object)
dec withUpdateableProperties(target: Model)
```

#### Target

`model object`
`Model`

#### Parameters
None
Expand All @@ -623,12 +623,12 @@ When using an emitter that applies visibility automatically, it is generally
not necessary to use this decorator.

```typespec
dec withVisibility(target: object, ...visibilities: string[])
dec withVisibility(target: Model, ...visibilities: string[])
```

#### Target

`model object`
`Model`

#### Parameters
| Name | Type | Description |
Expand Down
4 changes: 2 additions & 2 deletions docs/standard-library/openapi/reference/decorators.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ Specify that this model is to be treated as the OpenAPI `default` response.
This differs from the compiler built-in `@error` decorator as this does not necessarily represent an error.

```typespec
dec OpenAPI.defaultResponse(target: object)
dec OpenAPI.defaultResponse(target: Model)
```

#### Target

`model object`
`Model`

#### Parameters

Expand Down
Loading