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
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"detail": "name",
"documentation": {
"kind": "markdown",
"value": "Type: `string` \n"
"value": "Type: `string` \nThe deployment name. Must be 1-64 characters, and can contain alphanumerics, underscores, parentheses, hyphens, and periods. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"detail": "name",
"documentation": {
"kind": "markdown",
"value": "Type: `string` \n"
"value": "Type: `string` \nThe deployment name. Must be 1-64 characters, and can contain alphanumerics, underscores, parentheses, hyphens, and periods. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"detail": "name",
"documentation": {
"kind": "markdown",
"value": "Type: `string` \n"
"value": "Type: `string` \nThe deployment name. Must be 1-64 characters, and can contain alphanumerics, underscores, parentheses, hyphens, and periods. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"detail": "name",
"documentation": {
"kind": "markdown",
"value": "Type: `string` \n"
"value": "Type: `string` \nThe deployment name. Must be 1-64 characters, and can contain alphanumerics, underscores, parentheses, hyphens, and periods. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
7 changes: 5 additions & 2 deletions src/Bicep.Core/LanguageConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,11 @@ public static TypeSymbol CreateModuleType(IFeatureProvider features, IEnumerable
var nameRequirednessFlags = TypePropertyFlags.None;
// Taken from the official REST specs for Microsoft.Resources/deployments
var nameType = TypeFactory.CreateStringType(minLength: 1, maxLength: 64, pattern: @"^[-\w._()]+$");
var nameDescription = "The deployment name. Must be 1-64 characters, and can contain alphanumerics, underscores, parentheses, hyphens, and periods.";

List<NamedTypeProperty> moduleProperties =
[
new(ModuleNamePropertyName, nameType, nameRequirednessFlags | TypePropertyFlags.DeployTimeConstant | TypePropertyFlags.ReadableAtDeployTime | TypePropertyFlags.LoopVariant),
new(ModuleNamePropertyName, nameType, nameRequirednessFlags | TypePropertyFlags.DeployTimeConstant | TypePropertyFlags.ReadableAtDeployTime | TypePropertyFlags.LoopVariant, nameDescription),
new(ResourceScopePropertyName, CreateResourceScopeReference(moduleScope), scopePropertyFlags),
new(ModuleParamsPropertyName, paramsType, paramsRequiredFlag | TypePropertyFlags.WriteOnly),
new(ModuleOutputsPropertyName, outputsType, TypePropertyFlags.ReadOnly),
Expand All @@ -407,9 +408,11 @@ public static TypeSymbol CreateUsingConfigType()
var optionalPropFlags = TypePropertyFlags.WriteOnly | TypePropertyFlags.DeployTimeConstant | TypePropertyFlags.ReadableAtDeployTime | TypePropertyFlags.DisallowAny;
var requiredPropFlags = optionalPropFlags | TypePropertyFlags.Required;

var nameDescription = "The deployment name. Must be 1-64 characters, and can contain alphanumerics, underscores, parentheses, hyphens, and periods.";

NamedTypeProperty[] commonProps = [
// Taken from the official REST specs for Microsoft.Resources/deployments
new(ModuleNamePropertyName, TypeFactory.CreateStringType(minLength: 1, maxLength: 64, pattern: @"^[-\w._()]+$"), optionalPropFlags),
new(ModuleNamePropertyName, TypeFactory.CreateStringType(minLength: 1, maxLength: 64, pattern: @"^[-\w._()]+$"), optionalPropFlags, nameDescription),
// TODO model this properly as a scope, rather than a string
new(ResourceScopePropertyName, LanguageConstants.String, requiredPropFlags),
];
Expand Down
Loading