Skip to content

Commit

Permalink
feat(*): Map Declaration Docs (#22)
Browse files Browse the repository at this point in the history
* fix(docs): update codegen hyperlink

Signed-off-by: jonathan.casey <[email protected]>

* feat(doc): add map doc

Signed-off-by: Jonathan Casey <[email protected]>

* doc: update for Maps

Signed-off-by: Jonathan Casey <[email protected]>

* doc: changes for PR comments

Signed-off-by: Jonathan Casey <[email protected]>

* Update docs/design/specification/model-maps.md

Co-authored-by: Matt Roberts <[email protected]>
Signed-off-by: Jonathan Casey <[email protected]>

* Update docs/design/specification/model-maps.md

Co-authored-by: Matt Roberts <[email protected]>
Signed-off-by: Jonathan Casey <[email protected]>

* Update docs/design/specification/model-maps.md

Co-authored-by: Matt Roberts <[email protected]>
Signed-off-by: Jonathan Casey <[email protected]>

---------

Signed-off-by: jonathan.casey <[email protected]>
Signed-off-by: Jonathan Casey <[email protected]>
Co-authored-by: Matt Roberts <[email protected]>
  • Loading branch information
jonathan-casey and mttrbrts authored May 9, 2024
1 parent 1ce9aab commit 7b20e2e
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions docs/design/specification/model-maps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
id: model-maps
title: Maps
sidebar_position: 9
---
A Map is a type which models data as key-value pairs. Conceptually, it relates closely to a Map type in Javascript or C#.

To enable this feature in Concerto, set an environment variable of `ENABLE_MAP_TYPE='true'` or provide `enableMapType` as an option to the Concerto `ModelManager` constructor.

## Supported Key Types

- Primitives: String, DateTime
- Scalars: String, DateTime

## Supported Value Types

- Primitives: String, DateTime, Integer, Long, Double, Boolean
- Scalars: String, Integer, Long, Double, Boolean
- Concepts: Identified & Non-Identified

```
map <name> {
o <required Concerto Key Type>
o <required Concerto Value Type>
}
```

Example:

```js
namespace org.acme.hr@1.0.0

map Checklist {
o String
o Boolean
}
```

Types used in a Map may be imported from external namespaces in a manner similar to other [imports](./model-imports.md).

```js
namespace org.acme.hr@1.0.0
import [email protected]

map Timeline {
o DateTime
o Activity
}
```

---

0 comments on commit 7b20e2e

Please sign in to comment.