feat: add ES annotations

This commit is contained in:
Benjamin Jöckel
2019-05-10 11:47:06 +02:00
parent 55b5248660
commit 9c424b0f96
41 changed files with 263 additions and 2 deletions

View File

@@ -29,3 +29,21 @@ To generate a documentation for the routes use the following command.
```shell
node --require ts-node/register src/cli.ts routes PATH/TO/ROUTES.md
```
### Annotations
Annotations are used to add additional informations to fields, which are used to autogenerate mappings from the core objects.
External dependencies can not be covered by the annotations. Documentation about some of the annotations can be found in: [typedoc](https://typedoc.org/guides/doccomments/)
| annotation | description | parameters |
|-------------------|-------------------------------------------|---------------|
| `@aggregatable` | used for generating of aggregations of the field if the core schema is used to put data into a database/key-value store | |
| `@float` | number field is interpreted as float | |
| `@indexable` | marks the type as indexable if the core schema is used to put data into a database/key-value store| |
| `@integer` | number field is interpreted as integer | |
| `@keyword` | string field is interpreted as keyword | |
| `@sortable` | field is sortable if the core schema is used to put data into a database/key-value store | sort method to be used: ducet, price, distance |
| `@text` | string field is interpreted as text | |
| `@validatable` | marks the type as validatable if the core schema is used to put data into a database/key-value store | |