Skip to content

Introduce since, description and default tags #324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 8, 2021
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
63 changes: 63 additions & 0 deletions docs/modeling-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,67 @@ class FooContainer {
baz: BazDefinition
faz: FazDefinition
}
```

### Additional information

If needed, you can specify additional information on each type with the approariate JSDoc tag.
Following you can find a list of the supported tags:

#### `@since`

Every API already has a `@since` tag, which describes when an API has been added.
You can specify an additional `@since` tag for every property that has been added afterwards.
If the tag is not defined, it's assumed that the property has been added with the API the first time

```ts
/**
* @since 7.10.0
*/
class FooRequest {
bar: string
/** @since 7.11.0 */
baz: string
faz: string
}
```

#### description

You can add a description for each property, in this case there is no need to use a JSDoc tag.

```ts
class Foo {
bar: string
/** You can baz! */
baz: string
faz: string
}
```

#### `@server_default`

The server side default value if the property is not specified.
Default values can only be specified on optional properties.

```ts
class Foo {
bar: string
/** @server_default hello */
baz?: string
faz: string
}
```

#### `@doc_url`

The documentation url for the parameter.

```ts
class Foo {
bar: string
/** @doc_url http://localhost:9200 */
baz?: string
faz: string
}
```
Loading