Skip to content

Commit 9232105

Browse files
authored
Merge pull request #199 from microsoftgraph/dkershaw10-userType
Generate 0.1.9-preview for beta and v1.0
2 parents 4c128f3 + e313575 commit 9232105

File tree

23 files changed

+13517
-102
lines changed

23 files changed

+13517
-102
lines changed

docs/DEVELOPMENT.md

Lines changed: 56 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,80 @@ This document describes the steps to setup development tools and run Bicep types
22

33
## Directory Structure
44

5-
`generated`: Generated artifacts, including types and index. See [/generated/index.md](./generated/index.md) for a searchable list of all the available types. You can view individual type definitions by clicking on api versions.
5+
`generated`: Generated artifacts, including types and index. See [/generated/index.md](../generated/index.md) for a searchable list of all the available types. You can view individual type definitions by clicking on api versions.
66

77
`src`: Source code for autorest, type generation script, and the type loader
88

99
`swagger/specification`: Swagger API Specification for Microsoft Graph resources
1010

11+
`msgraph-metadata`: A submodule that links to the microsoftgraph/msgraph-metadata repo, which contains all the latest sanitized versions of the metadata (including descriptions, annotations and errors)
12+
13+
1114
## Running Generation Locally
15+
16+
### Pre-requisites
17+
18+
1. NPM version 22.0 or later
19+
1220
### Initial Setup
21+
1322
1. Clone this repo
1423
1. Check out submodules:
24+
1525
```sh
1626
git submodule update --init --recursive
1727
```
18-
1. Build the `bicep-types` dependency:
19-
```sh
20-
pushd bicep-types/src/bicep-types
21-
npm ci
22-
npm run build
23-
popd
24-
```
25-
1. Build the autorest extension code:
26-
```sh
27-
cd src/autorest.bicep
28-
npm ci
29-
npm run build
30-
```
31-
1. Change to the generator directory, and install dependencies:
28+
29+
### Configuration setup
30+
31+
#### Update the YML config files, if necessary
32+
33+
If you are adding new types or changing property annotations like `readOnly` or `required`, you'll need to update the yml config that controls what is generated.
34+
35+
```sh
36+
cd ../swagger-generation/configs
37+
```
38+
39+
Create new yml files (following the existing naming convention and a new semantic version) under the `beta` and `v1.0` folders.
40+
Edit the new yml files, with new types, properties and/or property annotation changes.
41+
42+
#### Configure which versions need generation
43+
44+
1. Update extensionConfig
45+
46+
From the root folder `/msgraph-bicep-types`:
47+
3248
```sh
33-
cd ../generator
34-
npm ci
49+
notepad src/extensionConfigs/extensionConfig.json
3550
```
3651
37-
### Running
38-
- To run generation for Microsoft Graph resources:
52+
Update the version numbers and save the file.
53+
54+
1. Add the new swagger version file names (to be generated in the next step).
55+
From the root folder `/msgraph-bicep-types`:
56+
3957
```sh
40-
npm run generate -- --specs-dir ..\..\swagger\ --single-path microsoftgraph
58+
notepad swagger/specification/microsoftgraph/preview/readme.md
4159
```
42-
The types should be available in [/generated](./generated)
4360
44-
- To see other available generation parameters, including debugging options:
45-
```sh
46-
npm run generate -- --help
61+
Edit the YML `input-file` sections to append the latest versions for beta and v1.0. Something like:
62+
63+
```yml
64+
input-file:
65+
- microsoftgraph/preview/beta/0.1.8-preview.json
66+
- microsoftgraph/preview/beta/0.1.9-preview.json <-- appending new version
67+
68+
input-file:
69+
- microsoftgraph/preview/v1.0/0.1.8-preview.json
70+
- microsoftgraph/preview/v1.0/0.1.9-preview.json <-- appending new version
4771
```
4872
49-
## Adding New Types
50-
1. Update the entities and properties in [config-beta.yml](src\swagger-generation\config-beta.yml) and [config-v1.0.yml](src\swagger-generation\config-beta.yml)
73+
### Generate the new types
74+
75+
From the root folder `/msgraph-bicep-types` run the following PowerShell script
76+
77+
```sh
78+
.\scripts\UpdateGeneratedTypes.ps1
79+
```
5180
52-
1. Follow steps in [Running Generation Locally](#running-generation-locally), and new types will be available in [/generated](./generated)
81+
After running the scripts the new types will be available in [/generated](./generated) folder.

generated/index.json

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,46 @@
11
{
22
"resources": {
33
"Microsoft.Graph/groups@beta": {
4-
"$ref": "microsoftgraph/microsoft.graph/beta/0.1.8-preview/types.json#/17"
4+
"$ref": "microsoftgraph/microsoft.graph/beta/0.1.9-preview/types.json#/18"
55
},
66
"Microsoft.Graph/applications@beta": {
7-
"$ref": "microsoftgraph/microsoft.graph/beta/0.1.8-preview/types.json#/73"
7+
"$ref": "microsoftgraph/microsoft.graph/beta/0.1.9-preview/types.json#/74"
88
},
99
"Microsoft.Graph/servicePrincipals@beta": {
10-
"$ref": "microsoftgraph/microsoft.graph/beta/0.1.8-preview/types.json#/91"
10+
"$ref": "microsoftgraph/microsoft.graph/beta/0.1.9-preview/types.json#/92"
1111
},
1212
"Microsoft.Graph/applications/federatedIdentityCredentials@beta": {
13-
"$ref": "microsoftgraph/microsoft.graph/beta/0.1.8-preview/types.json#/96"
13+
"$ref": "microsoftgraph/microsoft.graph/beta/0.1.9-preview/types.json#/97"
1414
},
1515
"Microsoft.Graph/oauth2PermissionGrants@beta": {
16-
"$ref": "microsoftgraph/microsoft.graph/beta/0.1.8-preview/types.json#/100"
16+
"$ref": "microsoftgraph/microsoft.graph/beta/0.1.9-preview/types.json#/101"
1717
},
1818
"Microsoft.Graph/appRoleAssignedTo@beta": {
19-
"$ref": "microsoftgraph/microsoft.graph/beta/0.1.8-preview/types.json#/104"
19+
"$ref": "microsoftgraph/microsoft.graph/beta/0.1.9-preview/types.json#/105"
20+
},
21+
"Microsoft.Graph/users@beta": {
22+
"$ref": "microsoftgraph/microsoft.graph/beta/0.1.9-preview/types.json#/110"
2023
},
2124
"Microsoft.Graph/[email protected]": {
22-
"$ref": "microsoftgraph/microsoft.graph/v1.0/0.1.8-preview/types.json#/13"
25+
"$ref": "microsoftgraph/microsoft.graph/v1.0/0.1.9-preview/types.json#/13"
2326
},
2427
"Microsoft.Graph/[email protected]": {
25-
"$ref": "microsoftgraph/microsoft.graph/v1.0/0.1.8-preview/types.json#/70"
28+
"$ref": "microsoftgraph/microsoft.graph/v1.0/0.1.9-preview/types.json#/70"
2629
},
2730
"Microsoft.Graph/[email protected]": {
28-
"$ref": "microsoftgraph/microsoft.graph/v1.0/0.1.8-preview/types.json#/88"
31+
"$ref": "microsoftgraph/microsoft.graph/v1.0/0.1.9-preview/types.json#/88"
2932
},
3033
"Microsoft.Graph/applications/[email protected]": {
31-
"$ref": "microsoftgraph/microsoft.graph/v1.0/0.1.8-preview/types.json#/93"
34+
"$ref": "microsoftgraph/microsoft.graph/v1.0/0.1.9-preview/types.json#/93"
3235
},
3336
"Microsoft.Graph/[email protected]": {
34-
"$ref": "microsoftgraph/microsoft.graph/v1.0/0.1.8-preview/types.json#/97"
37+
"$ref": "microsoftgraph/microsoft.graph/v1.0/0.1.9-preview/types.json#/97"
3538
},
3639
"Microsoft.Graph/[email protected]": {
37-
"$ref": "microsoftgraph/microsoft.graph/v1.0/0.1.8-preview/types.json#/101"
40+
"$ref": "microsoftgraph/microsoft.graph/v1.0/0.1.9-preview/types.json#/101"
41+
},
42+
"Microsoft.Graph/[email protected]": {
43+
"$ref": "microsoftgraph/microsoft.graph/v1.0/0.1.9-preview/types.json#/106"
3844
}
3945
},
4046
"resourceFunctions": {}

generated/index.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
# Bicep Types
22
## microsoft.graph
33
### microsoft.graph/applications
4-
* **Link**: [beta](microsoftgraph/microsoft.graph/beta/0.1.8-preview/types.md#resource-microsoftgraphapplicationsbeta)
5-
* **Link**: [v1.0](microsoftgraph/microsoft.graph/v1.0/0.1.8-preview/types.md#resource-microsoftgraphapplicationsv10)
4+
* **Link**: [beta](microsoftgraph/microsoft.graph/beta/0.1.9-preview/types.md#resource-microsoftgraphapplicationsbeta)
5+
* **Link**: [v1.0](microsoftgraph/microsoft.graph/v1.0/0.1.9-preview/types.md#resource-microsoftgraphapplicationsv10)
66

77
### microsoft.graph/applications/federatedidentitycredentials
8-
* **Link**: [beta](microsoftgraph/microsoft.graph/beta/0.1.8-preview/types.md#resource-microsoftgraphapplicationsfederatedidentitycredentialsbeta)
9-
* **Link**: [v1.0](microsoftgraph/microsoft.graph/v1.0/0.1.8-preview/types.md#resource-microsoftgraphapplicationsfederatedidentitycredentialsv10)
8+
* **Link**: [beta](microsoftgraph/microsoft.graph/beta/0.1.9-preview/types.md#resource-microsoftgraphapplicationsfederatedidentitycredentialsbeta)
9+
* **Link**: [v1.0](microsoftgraph/microsoft.graph/v1.0/0.1.9-preview/types.md#resource-microsoftgraphapplicationsfederatedidentitycredentialsv10)
1010

1111
### microsoft.graph/approleassignedto
12-
* **Link**: [beta](microsoftgraph/microsoft.graph/beta/0.1.8-preview/types.md#resource-microsoftgraphapproleassignedtobeta)
13-
* **Link**: [v1.0](microsoftgraph/microsoft.graph/v1.0/0.1.8-preview/types.md#resource-microsoftgraphapproleassignedtov10)
12+
* **Link**: [beta](microsoftgraph/microsoft.graph/beta/0.1.9-preview/types.md#resource-microsoftgraphapproleassignedtobeta)
13+
* **Link**: [v1.0](microsoftgraph/microsoft.graph/v1.0/0.1.9-preview/types.md#resource-microsoftgraphapproleassignedtov10)
1414

1515
### microsoft.graph/groups
16-
* **Link**: [beta](microsoftgraph/microsoft.graph/beta/0.1.8-preview/types.md#resource-microsoftgraphgroupsbeta)
17-
* **Link**: [v1.0](microsoftgraph/microsoft.graph/v1.0/0.1.8-preview/types.md#resource-microsoftgraphgroupsv10)
16+
* **Link**: [beta](microsoftgraph/microsoft.graph/beta/0.1.9-preview/types.md#resource-microsoftgraphgroupsbeta)
17+
* **Link**: [v1.0](microsoftgraph/microsoft.graph/v1.0/0.1.9-preview/types.md#resource-microsoftgraphgroupsv10)
1818

1919
### microsoft.graph/oauth2permissiongrants
20-
* **Link**: [beta](microsoftgraph/microsoft.graph/beta/0.1.8-preview/types.md#resource-microsoftgraphoauth2permissiongrantsbeta)
21-
* **Link**: [v1.0](microsoftgraph/microsoft.graph/v1.0/0.1.8-preview/types.md#resource-microsoftgraphoauth2permissiongrantsv10)
20+
* **Link**: [beta](microsoftgraph/microsoft.graph/beta/0.1.9-preview/types.md#resource-microsoftgraphoauth2permissiongrantsbeta)
21+
* **Link**: [v1.0](microsoftgraph/microsoft.graph/v1.0/0.1.9-preview/types.md#resource-microsoftgraphoauth2permissiongrantsv10)
2222

2323
### microsoft.graph/serviceprincipals
24-
* **Link**: [beta](microsoftgraph/microsoft.graph/beta/0.1.8-preview/types.md#resource-microsoftgraphserviceprincipalsbeta)
25-
* **Link**: [v1.0](microsoftgraph/microsoft.graph/v1.0/0.1.8-preview/types.md#resource-microsoftgraphserviceprincipalsv10)
24+
* **Link**: [beta](microsoftgraph/microsoft.graph/beta/0.1.9-preview/types.md#resource-microsoftgraphserviceprincipalsbeta)
25+
* **Link**: [v1.0](microsoftgraph/microsoft.graph/v1.0/0.1.9-preview/types.md#resource-microsoftgraphserviceprincipalsv10)
26+
27+
### microsoft.graph/users
28+
* **Link**: [beta](microsoftgraph/microsoft.graph/beta/0.1.9-preview/types.md#resource-microsoftgraphusersbeta)
29+
* **Link**: [v1.0](microsoftgraph/microsoft.graph/v1.0/0.1.9-preview/types.md#resource-microsoftgraphusersv10)
2630

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"resources": {
3+
"Microsoft.Graph/groups@beta": {
4+
"$ref": "types.json#/18"
5+
},
6+
"Microsoft.Graph/applications@beta": {
7+
"$ref": "types.json#/74"
8+
},
9+
"Microsoft.Graph/servicePrincipals@beta": {
10+
"$ref": "types.json#/92"
11+
},
12+
"Microsoft.Graph/applications/federatedIdentityCredentials@beta": {
13+
"$ref": "types.json#/97"
14+
},
15+
"Microsoft.Graph/oauth2PermissionGrants@beta": {
16+
"$ref": "types.json#/101"
17+
},
18+
"Microsoft.Graph/appRoleAssignedTo@beta": {
19+
"$ref": "types.json#/105"
20+
},
21+
"Microsoft.Graph/users@beta": {
22+
"$ref": "types.json#/110"
23+
}
24+
},
25+
"resourceFunctions": {},
26+
"settings": {
27+
"name": "MicrosoftGraphBeta",
28+
"version": "0.1.9-preview",
29+
"isSingleton": false
30+
}
31+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Bicep Types
2+
## microsoft.graph
3+
### microsoft.graph/applications
4+
* **Link**: [beta](types.md#resource-microsoftgraphapplicationsbeta)
5+
6+
### microsoft.graph/applications/federatedidentitycredentials
7+
* **Link**: [beta](types.md#resource-microsoftgraphapplicationsfederatedidentitycredentialsbeta)
8+
9+
### microsoft.graph/approleassignedto
10+
* **Link**: [beta](types.md#resource-microsoftgraphapproleassignedtobeta)
11+
12+
### microsoft.graph/groups
13+
* **Link**: [beta](types.md#resource-microsoftgraphgroupsbeta)
14+
15+
### microsoft.graph/oauth2permissiongrants
16+
* **Link**: [beta](types.md#resource-microsoftgraphoauth2permissiongrantsbeta)
17+
18+
### microsoft.graph/serviceprincipals
19+
* **Link**: [beta](types.md#resource-microsoftgraphserviceprincipalsbeta)
20+
21+
### microsoft.graph/users
22+
* **Link**: [beta](types.md#resource-microsoftgraphusersbeta)
23+

0 commit comments

Comments
 (0)