Skip to content

Latest commit

 

History

History
31 lines (28 loc) · 1.94 KB

File metadata and controls

31 lines (28 loc) · 1.94 KB
title url geekdocNav geekdocAlign geekdocAnchor type tags priority
BCPNFR20 - User-defined types - Export
/spec/BCPNFR20
true
left
true
posts
Class-Resource
Class-Pattern
Type-NonFunctional
Category-Inputs/Outputs
Language-Bicep
Severity-MUST
Persona-Owner
Persona-Contributor
Lifecycle-BAU
Validation-TBD
11010

ID: BCPNFR20 - Category: User-defined types - Export

User-defined types (UDTs) SHOULD always be exported via the @export() annotation in every template they're implemented in.

@export()
type subnetType = { ... }

Doing so has the benefit that other (e.g., parent) modules can import them and as such reduce code duplication. Also, if the module itself is published, users of the Public Bicep Registry can import the types independently of the module itself. One example where this can be useful is a pattern module that may re-use the same interface when referencing a module from the registry.