Skip to content

Commit 6e6377a

Browse files
authored
Introduce since, description and default tags (#324)
1 parent 18e58fb commit 6e6377a

File tree

5 files changed

+779
-10
lines changed

5 files changed

+779
-10
lines changed

docs/modeling-guide.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,4 +278,67 @@ class FooContainer {
278278
baz: BazDefinition
279279
faz: FazDefinition
280280
}
281+
```
282+
283+
### Additional information
284+
285+
If needed, you can specify additional information on each type with the approariate JSDoc tag.
286+
Following you can find a list of the supported tags:
287+
288+
#### `@since`
289+
290+
Every API already has a `@since` tag, which describes when an API has been added.
291+
You can specify an additional `@since` tag for every property that has been added afterwards.
292+
If the tag is not defined, it's assumed that the property has been added with the API the first time
293+
294+
```ts
295+
/**
296+
* @since 7.10.0
297+
*/
298+
class FooRequest {
299+
bar: string
300+
/** @since 7.11.0 */
301+
baz: string
302+
faz: string
303+
}
304+
```
305+
306+
#### description
307+
308+
You can add a description for each property, in this case there is no need to use a JSDoc tag.
309+
310+
```ts
311+
class Foo {
312+
bar: string
313+
/** You can baz! */
314+
baz: string
315+
faz: string
316+
}
317+
```
318+
319+
#### `@server_default`
320+
321+
The server side default value if the property is not specified.
322+
Default values can only be specified on optional properties.
323+
324+
```ts
325+
class Foo {
326+
bar: string
327+
/** @server_default hello */
328+
baz?: string
329+
faz: string
330+
}
331+
```
332+
333+
#### `@doc_url`
334+
335+
The documentation url for the parameter.
336+
337+
```ts
338+
class Foo {
339+
bar: string
340+
/** @doc_url http://localhost:9200 */
341+
baz?: string
342+
faz: string
343+
}
281344
```

0 commit comments

Comments
 (0)