Skip to content

Commit

Permalink
feat(alias-import): doc updated for aliased import (#46)
Browse files Browse the repository at this point in the history
* feat(alias-import): doc updated  for aliased import

Signed-off-by: Jaskeerat Singh Saluja <[email protected]>

* feat(alias-import): importAliasing variable added to docs

Signed-off-by: Jaskeerat Singh Saluja <[email protected]>

* feat(alias-import): Pr suggestions

Signed-off-by: Jaskeerat Singh Saluja <[email protected]>

* feat(alias-import):environment variable added to docs

Signed-off-by: Jaskeerat Singh Saluja <[email protected]>

---------

Signed-off-by: Jaskeerat Singh Saluja <[email protected]>
Co-authored-by: Jaskeerat Singh Saluja <[email protected]>
  • Loading branch information
salujajaskeerat and Jaskeerat Singh Saluja authored Sep 4, 2024
1 parent 911c0d4 commit 84e7241
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/design/specification/model-imports.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,23 @@ Imports using a `from` declaration can be downloaded into the model manager by c

The Model Manager will resolve all imports to ensure that the set of declarations that have been loaded are globally consistent.

## Aliasing imported types

Imported types can also be aliased to local names. Aliasing is only allowed using the `{}` syntax. Aliased and non-aliased types can be mixed within the same import statement, as demonstrated in the example below
```js

import [email protected].{PostalAddress as pa, Country}

concept Person{
o String name
o pa address optional
o Country country
}
```

**Note:** Aliasing is disabled by default in concerto. To enable this feature in Concerto, set environment variable `IMPORT_ALIASING='true'` or provide `importAliasing` as an option to the Concerto ModelManager constructor.


## Strict:false mode

For backwards compatability, and when running with `strict:false` imports may import types from unversioned namespaces, or may import all types in a namespace.
Expand Down

0 comments on commit 84e7241

Please sign in to comment.