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
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@autorest/openapi-to-typespec",
"comment": "Fix the missing properties of resource model. Remove useless conditionalFlattern.",
"type": "patch"
}
],
"packageName": "@autorest/openapi-to-typespec"
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,7 @@ options:
azure-resource-provider-folder: "resource-manager"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/${swaggerName}"
emit-lro-options: "all"
examples-dir: "{project-root}/examples"${
isFullCompatible
? `
arm-resource-flattening: true`
: ""
}
examples-dir: "{project-root}/examples"
linter:
extends:
- "@azure-tools/typespec-azure-rulesets/resource-manager"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Operation, Parameter, Property, SchemaType } from "@autorest/codemodel";
import { getAllProperties, Operation, Parameter, Property, SchemaType } from "@autorest/codemodel";
import { capitalize } from "@azure-tools/codegen";
import _ from "lodash";
import { singular } from "pluralize";
Expand Down Expand Up @@ -946,7 +946,7 @@ function getOtherProperties(
knownProperties.push(...["location", "tags"]);
}
const otherProperties: (TypespecObjectProperty | TypespecSpreadStatement)[] = [];
for (const property of schema.properties ?? []) {
for (const property of getAllProperties(schema)) {
if (!knownProperties.includes(property.serializedName)) {
const envolopeProperty = getEnvelopeProperty(property);
otherProperties.push(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,6 @@ export function getPropertyDecorators(element: Property | Parameter): TypespecDe
});
}

if (element.extensions?.["x-ms-client-flatten"] && isFullCompatible) {
decorators.push({
name: "Azure.ResourceManager.Private.conditionalClientFlatten",
suppressionCode: "@azure-tools/typespec-azure-core/no-private-usage",
suppressionMessage: "For backward compatibility",
});
}

return decorators;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2085,8 +2085,7 @@
"properties": {
"properties": {
"$ref": "#/definitions/DataConnectorProperties",
"description": "DataConnector Properties.",
"x-ms-client-flatten": true
"description": "DataConnector Properties."
},
"eTag": {
"type": "string",
Expand Down Expand Up @@ -2163,8 +2162,7 @@
"properties": {
"properties": {
"$ref": "#/definitions/DataManagerForAgricultureExtensionProperties",
"description": "DataManagerForAgricultureExtension properties.",
"x-ms-client-flatten": true
"description": "DataManagerForAgricultureExtension properties."
}
},
"allOf": [
Expand Down Expand Up @@ -2338,8 +2336,7 @@
"properties": {
"properties": {
"$ref": "#/definitions/DataManagerForAgricultureSolutionProperties",
"description": "DataManagerForAgricultureSolution properties.",
"x-ms-client-flatten": true
"description": "DataManagerForAgricultureSolution properties."
}
},
"allOf": [
Expand Down Expand Up @@ -2804,8 +2801,7 @@
"properties": {
"properties": {
"$ref": "#/definitions/SolutionProperties",
"description": "Solution resource properties.",
"x-ms-client-flatten": true
"description": "Solution resource properties."
},
"eTag": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ options:
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/agfood.json"
emit-lro-options: "all"
examples-dir: "{project-root}/examples"
arm-resource-flattening: true
linter:
extends:
- "@azure-tools/typespec-azure-rulesets/resource-manager"
Original file line number Diff line number Diff line change
Expand Up @@ -1847,8 +1847,7 @@
"properties": {
"properties": {
"$ref": "#/definitions/AlertProperties",
"description": "Alert property bag",
"x-ms-client-flatten": true
"description": "Alert property bag"
}
},
"allOf": [
Expand Down Expand Up @@ -1949,8 +1948,7 @@
"properties": {
"properties": {
"$ref": "#/definitions/AlertProcessingRuleProperties",
"description": "Alert processing rule properties.",
"x-ms-client-flatten": true
"description": "Alert processing rule properties."
}
},
"allOf": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,6 @@ model PatchObject {
/**
* Properties supported by patch operation.
*/
#suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility"
@Azure.ResourceManager.Private.conditionalClientFlatten
properties?: PatchProperties;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ options:
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json"
emit-lro-options: "all"
examples-dir: "{project-root}/examples"
arm-resource-flattening: true
linter:
extends:
- "@azure-tools/typespec-azure-rulesets/resource-manager"
Original file line number Diff line number Diff line change
Expand Up @@ -801,8 +801,15 @@
"$ref": "#/definitions/AnalysisServicesServerProperties",
"description": "Properties of the provision operation request.",
"x-ms-client-flatten": true
},
"sku": {
"$ref": "#/definitions/ResourceSku",
"description": "The SKU of the Analysis Services resource."
}
},
"required": [
"sku"
],
"allOf": [
{
"$ref": "../../common-types/resource-management/v3/types.json#/definitions/TrackedResource"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ model AnalysisServicesServer
SegmentName = "servers",
NamePattern = "^[a-z][a-z0-9]*$"
>;

/**
* The SKU of the Analysis Services resource.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility"
sku: ResourceSku;
}

@armResourceOperations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,6 @@ model AnalysisServicesServerUpdateParameters {
/**
* Properties of the provision operation request.
*/
#suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility"
@Azure.ResourceManager.Private.conditionalClientFlatten
properties?: AnalysisServicesServerMutableProperties;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ options:
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/analysisservices.json"
emit-lro-options: "all"
examples-dir: "{project-root}/examples"
arm-resource-flattening: true
linter:
extends:
- "@azure-tools/typespec-azure-rulesets/resource-manager"
Loading
Loading