Skip to content

Commit 9850bc4

Browse files
authored
Merge pull request #1782 from Azure/autogenerate
Autogenerate
2 parents d068a1c + 3e0680d commit 9850bc4

File tree

48 files changed

+49987
-1628
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+49987
-1628
lines changed

generator/autogenlist.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { postProcessor as machineLearningPostProcessor } from './processors/Micr
55
import { postProcessor as machineLearningServicesPostProcessor } from './processors/Microsoft.MachineLearningServices';
66
import { postProcessor as storageProcessor } from './processors/Microsoft.Storage';
77
import { postProcessor as policyProcessor } from './processors/Microsoft.Authorization';
8+
import { postProcessor as securityInsightsPostProcessor } from './processors/Microsoft.SecurityInsights';
89
import { lowerCaseEquals } from './utils';
910

1011
// Run "npm run list-basepaths" to discover all the valid readme files to add to this list
@@ -73,10 +74,6 @@ const autoGenList: AutoGenConfig[] = [
7374
basePath: 'batch/resource-manager',
7475
namespace: 'Microsoft.Batch',
7576
},
76-
{
77-
basePath: 'batchai/resource-manager',
78-
namespace: 'Microsoft.BatchAI',
79-
},
8077
{
8178
basePath: 'blockchain/resource-manager',
8279
namespace: 'Microsoft.Blockchain',
@@ -602,6 +599,7 @@ const autoGenList: AutoGenConfig[] = [
602599
{
603600
basePath: 'securityinsights/resource-manager',
604601
namespace: 'Microsoft.SecurityInsights',
602+
postProcessor: securityInsightsPostProcessor,
605603
},
606604
{
607605
basePath: 'storageimportexport/resource-manager',
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { SchemaPostProcessor } from '../models';
2+
import { replaceCyclicRef } from './helpers';
23

34
export const postProcessor: SchemaPostProcessor = (namespace: string, apiVersion: string, schema: any) => {
4-
const cyclicRef = schema.definitions?.ModeValueInfo?.properties?.parameters?.oneOf[0]?.items;
5-
if (cyclicRef && cyclicRef['$ref']) {
6-
delete cyclicRef['$ref'];
7-
cyclicRef['type'] = 'object';
8-
}
5+
replaceCyclicRef(schema.definitions?.ModeValueInfo?.properties?.parameters?.oneOf[0]?.items);
96
}
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { SchemaPostProcessor } from '../models';
2+
import { replaceCyclicRef } from './helpers';
23

34
export const postProcessor: SchemaPostProcessor = (namespace: string, apiVersion: string, schema: any) => {
4-
const cyclicRef = schema.definitions?.LabelClass?.properties?.subclasses?.oneOf[0]?.additionalProperties;
5-
if (cyclicRef && cyclicRef['$ref']) {
6-
delete cyclicRef['$ref'];
7-
cyclicRef['type'] = 'object';
8-
}
5+
replaceCyclicRef(schema.definitions?.LabelClass?.properties?.subclasses?.oneOf[0]?.additionalProperties);
96
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { SchemaPostProcessor } from '../models';
2+
import { replaceCyclicRef } from './helpers';
3+
4+
export const postProcessor: SchemaPostProcessor = (namespace: string, apiVersion: string, schema: any) => {
5+
replaceCyclicRef(schema.definitions?.MetadataDependencies?.properties?.criteria?.oneOf[0]?.items);
6+
}

generator/processors/helpers.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export const replaceCyclicRef = (cyclicRef: any) => {
2+
if (cyclicRef && cyclicRef['$ref']) {
3+
delete cyclicRef['$ref'];
4+
cyclicRef['type'] = 'object';
5+
}
6+
}

0 commit comments

Comments
 (0)