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
7 changes: 6 additions & 1 deletion src/autorest.bicep/src/schema-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,20 +285,23 @@ export function generateSchema(host: AutorestExtensionHost, definition: Provider
return {
type: 'string',
format: combinedSchema.format,
default: combinedSchema.defaultValue,
};
}

if (combinedSchema instanceof UuidSchema) {
return {
type: 'string',
pattern: '^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$'
pattern: '^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$',
default: combinedSchema.defaultValue,
};
}

if (combinedSchema instanceof StringSchema) {
return {
type: 'string',
pattern: combinedSchema.pattern,
default: combinedSchema.defaultValue,
minLength: combinedSchema.minLength,
maxLength: combinedSchema.maxLength,
};
Expand All @@ -307,6 +310,7 @@ export function generateSchema(host: AutorestExtensionHost, definition: Provider
if (combinedSchema instanceof NumberSchema) {
return {
type: combinedSchema.type,
default: combinedSchema.defaultValue,
minimum: combinedSchema.minimum,
maximum: combinedSchema.maximum,
multipleOf: combinedSchema.multipleOf,
Expand All @@ -315,6 +319,7 @@ export function generateSchema(host: AutorestExtensionHost, definition: Provider

return {
type: toBuiltInTypeKind(combinedSchema),
default: combinedSchema.defaultValue,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,17 @@
}
]
},
"intWithDefaultValue": {
"oneOf": [
{
"default": 7,
"type": "integer"
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
]
},
"password": {
"oneOf": [
{
Expand Down Expand Up @@ -551,6 +562,17 @@
}
]
},
"intWithDefaultValue": {
"oneOf": [
{
"default": 7,
"type": "integer"
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
]
},
"locationData": {
"description": "Metadata pertaining to the geographic location of the resource.",
"oneOf": [
Expand Down
Loading