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
5 changes: 5 additions & 0 deletions compiler/src/model/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,11 @@ function hoistPropertyAnnotations (property: model.Property, jsDocs: JSDoc[]): v
assert(jsDocs, Array.isArray(value), 'The default value should be an array')
property.serverDefault = value
} else {
// JSDoc prevents literal @ in values, but the at sign can be escaped
if (value.startsWith('\\@')) {
value = value.replace('\\@', '@')
}

switch (property.type.type.name) {
case 'boolean':
assert(jsDocs, value === 'true' || value === 'false', `The default value for ${property.name} should be a boolean`)
Expand Down
12 changes: 12 additions & 0 deletions docs/modeling-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,18 @@ class Foo {
}
```

If you need an `@` sign, you can escape it:

```ts
class Foo {
/**
* Field containing event timestamp.
* @server_default \@timestamp
*/
timestamp_field?: Field
}
```

#### `@doc_id`

An identifier that can be used for generating the doc url in clients.
Expand Down
5 changes: 3 additions & 2 deletions output/openapi/elasticsearch-openapi.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions output/openapi/elasticsearch-serverless-openapi.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions output/schema/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion specification/eql/search/EqlSearchRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ export interface Request extends RequestBase {
*/
tiebreaker_field?: Field
/**
* Field containing event timestamp. Default "@timestamp"
* Field containing event timestamp.
* @server_default \@timestamp
*/
timestamp_field?: Field
/**
Expand Down
2 changes: 1 addition & 1 deletion specification/ingest/_types/Processors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ export class DateProcessor extends ProcessorBase {
locale?: string
/**
* The field that will hold the parsed date.
* @server_default `@timestamp`
* @server_default \@timestamp
*/
target_field?: Field
/**
Expand Down
Loading