GithubHelp home page GithubHelp logo

microsoftgraph / msgraph-metadata Goto Github PK

View Code? Open in Web Editor NEW
98.0 31.0 28.0 915.43 MB

Microsoft Graph metadata captured and used for generating client library code files.

Home Page: https://graph.microsoft.com

License: MIT License

PowerShell 3.00% XSLT 97.00%
kiota-index azure-active-directory exchange microsoft-graph office365 onedrive onenote outlook planner sharepoint teams todo devxeng

msgraph-metadata's Introduction

Graph metadata used for generating client code files

This repository contains scripts used to capture metadata from the Microsoft Graph service and the captured metadata. We use this metadata to generate code files for .Net, Java, TypeScript, PHP, and other languages.

msgraph-metadata's People

Contributors

andrueastman avatar baywet avatar darrelmiller avatar dependabot[bot] avatar github-actions[bot] avatar irvinesunday avatar ivy-rew avatar madansr7 avatar marabooy avatar martinm85 avatar michaelmainer avatar millicentachieng avatar peombwa avatar ramsessanchez avatar svrooij avatar thewahome avatar timayabi2020 avatar zengin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

msgraph-metadata's Issues

Get-MGUserEventInstance needs time parameters

Get-MGUserEventInstance fails with the message Get-MgUserEventInstance_List: This request requires a time window specified by the query string parameters StartDateTime and EndDateTime.

The Graph API Docs for "list instances" shows that start and end times are required but none of the parameters allow this.

Steps to reproduce

$targetMailbox = '[email protected]'
$eventFilter = "Subject eq 'Meeting'"
$event = Get-MgUserEvent -UserId $targetMailbox -filter $eventFilter
Get-MgUserEventInstance -UserId $targetMailbox -EventId $event.Id -debug

The workaround:

$Uri = "https://graph.microsoft.com/beta/users/$targetMailbox/events/$($event.Id)/instances?startDateTime=2022-02-23T00:00:00&endDateTime=2022-02-24T00:00:00&$select=subject,bodyPreview,seriesMasterId,type,recurrence,start,end"
$Results = Invoke-MgGraphRequest -uri $uri -method GET 

Remove-MgAgreementAcceptance failing to run

I can run "Get-MgAgreementAcceptance -AgreementId " to get the acceptances of that agreement. However running "Remove-MgAgreementAcceptance -AgreementAcceptanceId -AgreementId" with an id from the first step and the same agreement id gives the error:
Remove-MgAgreementAcceptance : No HTTP resource was found that matches the request URI
'https://api.termsofuse.identitygovernance.azure.com/v2.0/agreements('<agreementid')/acceptances('<agreementacceptanceid')?x-scenario=MSGraph&x-tenantid=[tenantId]'.
At line:1 char:1

  • $agreementAcceptance |Remove-MgAgreementAcceptance
  •   + CategoryInfo          : InvalidOperation: ({ IfMatch =  }:<>f__AnonymousType82`1) [Remove-MgAgreem...leteViaIdentity], RestException`1
      + FullyQualifiedErrorId : Microsoft.Graph.PowerShell.Cmdlets.RemoveMgAgreementAcceptance_DeleteViaIdentity
    

(NB: [tenantId] is as it appears in the error message.
I get the same error contructing a hash and passing it to the function.
I can find very little documentation around this function, am I calling it incorrectly, or is there an issue with the function?

Validation for Group ownership is broken

There are recently added undocumented validation rules for Group ownership in Microsoft Graph which are broken. Discussions with the service team would indicate that this validation is intended to affect Microsoft 365 (unified) groups with the goal of preventing group creation without a group having an owner that is a user principal. However at the same time we are seeing errors around group ownership for security groups too and the behavior is inconsistent, sometimes preventing creation of a group no matter what combination of owners are specified.

At group creation time, this seems to manifest in a 400 response with the following error description:

HTTP/1.1 400 Bad Request

Date: Thu, 29 Jul 2021 10:20:37 GMT
Content-Type: application/json
Cache-Control: no-cache
Transfer-Encoding: chunked
Content-Encoding: gzip
Vary: Accept-Encoding
Strict-Transport-Security: max-age=31536000
request-id: fe3ae0a7-46d6-4a29-9c23-9ed2c4ad0b0a
client-request-id: fe3ae0a7-46d6-4a29-9c23-9ed2c4ad0b0a
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West Europe","Slice":"E","Ring":"5","ScaleUnit":"003","RoleInstance":"AM1PEPF000051D7"}}
Link: <https://developer.microsoft-tst.com/en-us/graph/changes?$filterby=beta,PrivatePreview:Restricted_AU_Properties&from=2021-04-01&to=2021-05-01>;rel="deprecation";type="text/html"
Deprecation: 
Sunset: 
x-ms-resource-unit: 1

{
    "error": {
        "code": "Request_BadRequest",
        "innerError": {
            "client-request-id": "fe3ae0a7-46d6-4a29-9c23-9ed2c4ad0b0a",
            "date": "2021-07-29T10:20:38",
            "request-id": "fe3ae0a7-46d6-4a29-9c23-9ed2c4ad0b0a"
        },
        "message": "Request contains a property with duplicate values."
    }
}

This does not correlate with the request payload which might for example look like the following:

POST https://graph.microsoft.com/beta/659c0000-0000-0000-0000-00000000a82e/groups
HTTP/1.1

Host: graph.microsoft.com
User-Agent: Hamilton (Go-http-client/1.1) HashiCorp Terraform/1.0.0 (+https://www.terraform.io) Terraform Plugin SDK/2.6.1 terraform-provider-azuread/1.6.0 pid-222c6c49-1b0a-5959-a213-6608f9eb8820
Content-Length: 233
Accept: application/json
Authorization: Bearer ...
Content-Type: application/json; charset=utf-8
Accept-Encoding: gzip

{
    "displayName": "foobar2",
    "mailEnabled": false,
    "mailNickname": "6fb69a33-5961-f0a4-6041-7af7712c0d06",
    "[email protected]": [
        "https://graph.microsoft.com/beta/directoryObjects/06ee5fa0-7a61-4313-bae7-4d1bf50cbb03"
    ],
    "securityEnabled": true
}

This error is returned despite:

  • The group being created not being a unified group but is a "traditional" AAD security group
  • The group has a valid owner specified
  • There are no duplicate fields or values, for owners or any other property

In addition, when removing owners from a group, where there are two owners and one of these is a service principal and the other is a user principal, and the group is a security group and not a unified group, a 400 response can sometimes be received with the following error:

The group must have at least one owner, hence this owner cannot be removed

These behaviors have been documented by ourselves and several community members, in the following related issues:

hashicorp/terraform-provider-azuread#464
hashicorp/terraform-provider-azuread#473
hashicorp/terraform-provider-azuread#478
hashicorp/terraform-provider-azuread#567

Organize XSLT based on scenario

We should organize our XSLT based on scenarios. This will mean have a primary XSLT (the existing one) and import the scenarios. Tentative scenarios:
-- metadataFix.xsl - where we inventory and add metadata to fix issues in the production metadata. This fix is temporary until it is fixed in the metadata.
-- toolingFix.xsl - where we inventory and alter metadata that works around issues in our generation tools. This fix is temporary until we fix the tools.
-- apiWorkaround.xsl - where we inventory and alter metadata that works around OData non-conformance.

#33
AB#6327

Change retrunType for M365 report functions to Edm.Steam

The converted OpenAPI document currently represents response type of most report functions as application/json instead of application/octet-stream. To solve this, we need to ensure that response types of functions bound to reportRoot are accurately represented in the converted OpenAPI. Without this, code generators won't be able to know how to properly handle responses.

Example

Currently

This CSDL with the wrong return type:
image
image

Gets converted to this in OpenAPI:
image

Expected

For reports to function as described in MS Graph docs, we need to ensure that they are described as shown below:
image

Related to microsoftgraph/msgraph-sdk-powershell#407

AB#9223

Set-MgApplicationLogo requires Content-Type to be image/*

Set-MgApplicationLogo fails with Content-Type was application/octet-stream. Image Content-Type header should be one of the following: [image/bmp, image/emf, image/wmf, image/jpg, image/jpeg, image/gif, image/ico, image/png, image/exif, image/tif, image/tiff, image/*, images/*]..

The OpenAPI document currently describes the content-type as application/octet-stream. AutoREST.PowerShell expects the right content-type to be explicitly described in the OpenAPI document.

Repro Steps

Set-MgApplicationLogo -ApplicationId $app.Id -InFile "C:\PATH_TO_LOGO\Logo.png"

Related to microsoftgraph/msgraph-sdk-powershell#1028, microsoftgraph/msgraph-sdk-powershell#935

Fix validation pipeline to only run on targeted resources

https://github.com/microsoftgraph/msgraph-metadata/blob/master/pipelines/validateCleanedMetadata_beta.yml#L36

Both the v1.0 and beta validatoin pipelines need an update to deal with the fact that resource pipeline triggers cannot be restricted on resource path spec. The triggers only work on branch path specs. This causes both pipelines to be run when changes are made to both v1.0 and beta metadata resources.

Essentially, the validation pipelines will have failures since the artifact it needs will not be available in one run, but will be available in the other run since it will be available.

https://developercommunity.visualstudio.com/content/idea/928461/support-path-filter-for-pipeline-build-trigger.html
AB#7455

OpenAPI generator doesn't work with YAMLs in this repo

Hi there,

I'm trying to use openapi-generator to generate some Rust code. But it seems that it doesn't work somehow. Here's the step to reproduce:

Firstly, I download the YAML description file from this repo by:

wget https://raw.githubusercontent.com/microsoftgraph/msgraph-metadata/master/openapi/v1.0/openapi.yaml

...and then I installed the openapi-generator via npm:

npm install @openapitools/openapi-generator-cli -g

...and then run the generator:

openapi-generator generate -g rust -o out -i openapi.yaml

It will show me some errors like this:

[main] WARN  io.swagger.v3.parser.OpenAPIV3Parser - Exception while reading:
com.fasterxml.jackson.dataformat.yaml.snakeyaml.error.YAMLException: special characters are not allowed
 at [Source: (StringReader); line: 359942, column: 20]
	at com.fasterxml.jackson.dataformat.yaml.snakeyaml.error.YAMLException.from(YAMLException.java:25)
	at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:361)
	at com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer.deserializeObject(JsonNodeDeserializer.java:249)
	at com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer.deserializeObject(JsonNodeDeserializer.java:255)
	at com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer.deserializeObject(JsonNodeDeserializer.java:255)
	at com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer.deserializeArray(JsonNodeDeserializer.java:434)
	at com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer.deserializeObject(JsonNodeDeserializer.java:258)
	at com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer.deserializeObject(JsonNodeDeserializer.java:255)
	at com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer.deserializeObject(JsonNodeDeserializer.java:255)
	at com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer.deserializeObject(JsonNodeDeserializer.java:255)
	at com.fasterxml.jackson.databind.deser.std.JsonNodeDeserializer.deserialize(JsonNodeDeserializer.java:68)
	at com.fasterxml.jackson.databind.deser.std.JsonNodeDeserializer.deserialize(JsonNodeDeserializer.java:15)
	at com.fasterxml.jackson.databind.ObjectMapper._readTreeAndClose(ObjectMapper.java:4056)
	at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:2551)
	at io.swagger.v3.parser.OpenAPIV3Parser.readWithInfo(OpenAPIV3Parser.java:154)
	at io.swagger.v3.parser.OpenAPIV3Parser.readLocation(OpenAPIV3Parser.java:58)
	at io.swagger.parser.OpenAPIParser.readLocation(OpenAPIParser.java:16)
	at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:410)
	at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:458)
	at org.openapitools.codegen.cmd.Generate.run(Generate.java:415)
	at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:60)
Caused by: org.yaml.snakeyaml.reader.ReaderException: special characters are not allowed
	at org.yaml.snakeyaml.reader.StreamReader.update(StreamReader.java:211)
	at org.yaml.snakeyaml.reader.StreamReader.ensureEnoughData(StreamReader.java:176)
	at org.yaml.snakeyaml.reader.StreamReader.peek(StreamReader.java:136)
	at org.yaml.snakeyaml.scanner.ScannerImpl.scanToNextToken(ScannerImpl.java:1185)
	at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:287)
	at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:227)
	at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingValue.produce(ParserImpl.java:586)
	at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
	at org.yaml.snakeyaml.parser.ParserImpl.getEvent(ParserImpl.java:168)
	at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:355)
	... 19 common frames omitted
[main] WARN  i.s.parser.util.DeserializationUtils - Error snake-parsing yaml content
io.swagger.parser.util.DeserializationUtils$SnakeException: Exception safe-checking yaml content  (maxDepth 2000)
	at io.swagger.parser.util.DeserializationUtils$CustomSnakeYamlConstructor.getSingleData(DeserializationUtils.java:300)
	at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:524)
	at org.yaml.snakeyaml.Yaml.load(Yaml.java:437)
	at io.swagger.parser.util.DeserializationUtils.readYamlTree(DeserializationUtils.java:137)
	at io.swagger.parser.Swagger20Parser.deserializeYaml(Swagger20Parser.java:83)
	at io.swagger.parser.Swagger20Parser.readWithInfo(Swagger20Parser.java:64)
	at io.swagger.parser.SwaggerParser.readWithInfo(SwaggerParser.java:32)
	at io.swagger.v3.parser.converter.SwaggerConverter.readLocation(SwaggerConverter.java:96)
	at io.swagger.parser.OpenAPIParser.readLocation(OpenAPIParser.java:16)
	at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:410)
	at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:458)
	at org.openapitools.codegen.cmd.Generate.run(Generate.java:415)
	at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:60)
Caused by: org.yaml.snakeyaml.reader.ReaderException: special characters are not allowed
	at org.yaml.snakeyaml.reader.StreamReader.update(StreamReader.java:211)
	at org.yaml.snakeyaml.reader.StreamReader.ensureEnoughData(StreamReader.java:176)
	at org.yaml.snakeyaml.reader.StreamReader.peek(StreamReader.java:136)
	at org.yaml.snakeyaml.scanner.ScannerImpl.scanToNextToken(ScannerImpl.java:1185)
	at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:287)
	at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:227)
	at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingValue.produce(ParserImpl.java:586)
	at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
	at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:124)
	at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:236)
	at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:227)
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:215)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:144)
	at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:236)
	at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:227)
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:215)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:144)
	at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:236)
	at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:227)
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:215)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:144)
	at org.yaml.snakeyaml.composer.Composer.composeSequenceNode(Composer.java:189)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:142)
	at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:236)
	at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:227)
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:215)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:144)
	at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:236)
	at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:227)
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:215)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:144)
	at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:236)
	at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:227)
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:215)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:144)
	at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:236)
	at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:227)
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:215)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:144)
	at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:85)
	at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:108)
	at io.swagger.parser.util.DeserializationUtils$CustomSnakeYamlConstructor.getSingleData(DeserializationUtils.java:279)
	... 12 common frames omitted
[main] WARN  i.s.parser.util.DeserializationUtils - Error snake-parsing yaml content
io.swagger.parser.util.DeserializationUtils$SnakeException: Exception safe-checking yaml content  (maxDepth 2000)
	at io.swagger.parser.util.DeserializationUtils$CustomSnakeYamlConstructor.getSingleData(DeserializationUtils.java:300)
	at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:524)
	at org.yaml.snakeyaml.Yaml.load(Yaml.java:437)
	at io.swagger.parser.util.DeserializationUtils.readYamlTree(DeserializationUtils.java:137)
	at io.swagger.parser.Swagger20Parser.deserializeYaml(Swagger20Parser.java:83)
	at io.swagger.parser.Swagger20Parser.readWithInfo(Swagger20Parser.java:64)
	at io.swagger.parser.SwaggerParser.readWithInfo(SwaggerParser.java:42)
	at io.swagger.v3.parser.converter.SwaggerConverter.readLocation(SwaggerConverter.java:96)
	at io.swagger.parser.OpenAPIParser.readLocation(OpenAPIParser.java:16)
	at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:410)
	at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:458)
	at org.openapitools.codegen.cmd.Generate.run(Generate.java:415)
	at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:60)
Caused by: org.yaml.snakeyaml.reader.ReaderException: special characters are not allowed
	at org.yaml.snakeyaml.reader.StreamReader.update(StreamReader.java:211)
	at org.yaml.snakeyaml.reader.StreamReader.ensureEnoughData(StreamReader.java:176)
	at org.yaml.snakeyaml.reader.StreamReader.peek(StreamReader.java:136)
	at org.yaml.snakeyaml.scanner.ScannerImpl.scanToNextToken(ScannerImpl.java:1185)
	at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:287)
	at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:227)
	at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingValue.produce(ParserImpl.java:586)
	at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
	at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:124)
	at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:236)
	at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:227)
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:215)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:144)
	at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:236)
	at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:227)
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:215)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:144)
	at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:236)
	at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:227)
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:215)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:144)
	at org.yaml.snakeyaml.composer.Composer.composeSequenceNode(Composer.java:189)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:142)
	at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:236)
	at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:227)
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:215)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:144)
	at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:236)
	at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:227)
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:215)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:144)
	at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:236)
	at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:227)
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:215)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:144)
	at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:236)
	at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:227)
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:215)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:144)
	at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:85)
	at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:108)
	at io.swagger.parser.util.DeserializationUtils$CustomSnakeYamlConstructor.getSingleData(DeserializationUtils.java:279)
	... 12 common frames omitted
[main] ERROR i.s.parser.SwaggerCompatConverter - failed to read resource listing
com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'openapi': was expecting ('true', 'false' or 'null')
 at [Source: (StringReader); line: 1, column: 8]
	at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1804)
	at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:673)
	at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._reportInvalidToken(ReaderBasedJsonParser.java:2835)
	at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1889)
	at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:747)
	at com.fasterxml.jackson.databind.ObjectMapper._readTreeAndClose(ObjectMapper.java:4042)
	at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:2551)
	at io.swagger.parser.SwaggerCompatConverter.readResourceListing(SwaggerCompatConverter.java:210)
	at io.swagger.parser.SwaggerCompatConverter.read(SwaggerCompatConverter.java:123)
	at io.swagger.parser.SwaggerCompatConverter.readWithInfo(SwaggerCompatConverter.java:94)
	at io.swagger.parser.SwaggerParser.readWithInfo(SwaggerParser.java:42)
	at io.swagger.v3.parser.converter.SwaggerConverter.readLocation(SwaggerConverter.java:96)
	at io.swagger.parser.OpenAPIParser.readLocation(OpenAPIParser.java:16)
	at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:410)
	at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:458)
	at org.openapitools.codegen.cmd.Generate.run(Generate.java:415)
	at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:60)
[main] ERROR i.s.parser.SwaggerCompatConverter - failed to read resource listing
com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'openapi': was expecting ('true', 'false' or 'null')
 at [Source: (StringReader); line: 1, column: 8]
	at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1804)
	at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:673)
	at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._reportInvalidToken(ReaderBasedJsonParser.java:2835)
	at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1889)
	at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:747)
	at com.fasterxml.jackson.databind.ObjectMapper._readTreeAndClose(ObjectMapper.java:4042)
	at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:2551)
	at io.swagger.parser.SwaggerCompatConverter.readResourceListing(SwaggerCompatConverter.java:210)
	at io.swagger.parser.SwaggerCompatConverter.read(SwaggerCompatConverter.java:123)
	at io.swagger.parser.SwaggerCompatConverter.readWithInfo(SwaggerCompatConverter.java:94)
	at io.swagger.parser.SwaggerParser.readWithInfo(SwaggerParser.java:42)
	at io.swagger.v3.parser.converter.SwaggerConverter.readLocation(SwaggerConverter.java:96)
	at io.swagger.parser.OpenAPIParser.readLocation(OpenAPIParser.java:16)
	at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:410)
	at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:458)
	at org.openapitools.codegen.cmd.Generate.run(Generate.java:415)
	at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:60)
Exception in thread "main" java.lang.NullPointerException
	at java.util.HashSet.<init>(HashSet.java:119)
	at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:413)
	at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:458)
	at org.openapitools.codegen.cmd.Generate.run(Generate.java:415)
	at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:60)

Did I miss something? Or is there any corruptions or syntax errors in the YAML file?

Regards,
Jackson
AB#7452

v1.0 metadata for functions returning a stream look incorrect

The type graph.report looks like this:

<ComplexType Name="report">
    <Property Name="content" Type="Edm.Stream"/>
</ComplexType>

The report type is returned by a number of functions, for example:

<Function Name="getMailboxUsageDetail" IsBound="true" IsComposable="true">
    <Parameter Name="bindingParameter" Type="graph.reportRoot"/>
    <Parameter Name="period" Type="Edm.String" Nullable="false" Unicode="false"/>
    <ReturnType Type="graph.report" Nullable="false"/>
</Function>

What this suggests to me is that the url to return the report (a CSV file to be read as a stream) above would look like this:

https://graph.microsoft.com/v1.0/reports/getMailboxUsageDetail(period%3D'D7')/content

but in fact the url to return the report is:

https://graph.microsoft.com/v1.0/reports/getMailboxUsageDetail(period%3D'D7')

I couldn't spot anything in the OData 4.01 specifications supporting this strange wrapping of the Stream type (with special behaviour to ignore the content property name). Why isn't the ReturnType for all these functions just Edm.Stream?

AB#7460

Remove-MgUserAuthenticationMethod Not Working

The command "Remove-MgUserAuthenticationMethod" doesn't work as expected.

https://docs.microsoft.com/en-us/powershell/module/microsoft.graph.identity.signins/remove-mguserauthenticationmethod?view=graph-powershell-beta

Remove-MgUserAuthenticationMethod -UserId [email protected] -AuthenticationMethodId 1234a56b-789c-0123-456d-78e9012345f6
Remove-MgUserAuthenticationMethod : {"Message":"No HTTP resource was found that matches the request URI
'https://mface.windowsazure.com/odata/users('TestUser%40domain.com')/authentication/methods('1234a56b-789c-0123-456d-78e9012345f6')'.","MessageDetail":"No type was found that matches
the controller named 'users'."}
At line:6 char:13

  •         Remove-MgUserAuthenticationMethod -UserId $MgUser.UserPri ...
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: ({ UserId = Test...7, IfMatch = }:<>f__AnonymousType993) [Remove-MgUserAuthenticationMethod_Delete], RestException1
    • FullyQualifiedErrorId : UnknownError,Microsoft.Graph.PowerShell.Cmdlets.RemoveMgUserAuthenticationMethod_Delete

Incorrect Success Response in deviceManagement.Functions

The OpenAPI Document Lists the Response for the following endpoint as shown below:-

/deviceManagement/virtualEndpoint/auditEvents/microsoft.graph.getAuditActivityTypes():
    get:
      tags:
        - deviceManagement.Functions
      summary: Invoke function getAuditActivityTypes
      operationId: deviceManagement.virtualEndpoint.auditEvents.getAuditActivityTypes
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                  nullable: true
        default:
          $ref: '#/components/responses/error'
      x-ms-docs-operation-type: function

However, the API returns the following format:-

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(Edm.String)",
    "value": [
        "*"
    ]
}

As such the above OpenAPI Doc should be changed to:-

  /deviceManagement/virtualEndpoint/auditEvents/microsoft.graph.getAuditActivityTypes():
    get:
      tags:
        - deviceManagement.Functions
      summary: Invoke function getAuditActivityTypes
      operationId: deviceManagement.virtualEndpoint.auditEvents_getAuditActivityTypes
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  value:
                   type: array
                   items:
                     type: string
                     nullable: true
        default:
          $ref: '#/components/responses/error'
      x-ms-docs-operation-type: function

This issue also affects getEffectivePermissions

The associated metadata:-
meta

AB#10213

Update-MgUserPlanner Should Support `If-match` header

Using Update-MgUserPlanner to update a plannerUser object fails with the following error:

PS C:\> Select-MgProfile beta
PS C:\> Update-MgUserPlanner -UserId $env:App_User_Id -Debug

DEBUG: URLCreated: https://graph.microsoft.com/beta/users/{user-id}/planner
Content-Type: application/json
{
}
Update-MgUserPlanner_UpdateExpanded: The If-Match header must be specified for this kind of request.
...

Customers do not currently have an option for specifying request headers. The OpenAPI spec states that a document should explicitly declare request headers in an operation's parameters object with an in: header e.g.,

  /planner:
    patch:
      tags:
        - planner.planner
      summary: Update planerUser object.
      operationId: planner.planner_UpdatePlanner
      parameters:
        - name: If-match
          in: header
          schema:
            type: string

AB#10676

Java code generation issue

I tried to generate java classes for MS graph beta API with the following command ,

.\scripts\runTypewriter.ps1 -verbosity Info -metadata https://raw.githubusercontent.com/microsoftgraph/msgraph-metadata/master/clean_beta_metadata/cleanMetadataWithDescriptionsbeta.xml -output .\temp -generationMode Files -cleanup $false -l Java โ€จ

however, it generate a huge amount of java classes (> 13k), which leads to slow compilation, are there any ways to exclude unused classes?
image

Regards
Pong

XSLT transform drops ProposedNewTime parameter

XSLT transform doesn't copy ProposedNewTime parameter while reordering of parameters alphabetically for tentativelyAccept and decline actions.

Assumption is that ProposedNewTime parameter didn't exist in metadata when the reordering rule was defined.
AB#7456

Wrong method used for Update Phone Method for MFA

Hello,
According to https://docs.microsoft.com/en-us/graph/api/phoneauthenticationmethod-update?view=graph-rest-beta&tabs=http&viewFallbackFrom=graph-rest-1.0 the method used to update the phone number is PUT but the current code is using PATCH method:
https://github.com/microsoftgraph/msgraph-metadata/blob/master/openapi/beta/openapi.yaml#L391776 (for the /me) and
https://github.com/microsoftgraph/msgraph-metadata/blob/master/openapi/beta/openapi.yaml#L634531 for /users)

I don't know if I can just do a PR for that or if it's just a generated file I should have to modify by myself.
Thank you :)
AB#7629

XSLT transform or code generator adds unnecessary baseType to complexTypes.

It looks like we are adding a base type to a complex type that shouldn't have one.

According to the live metadata, chatMessageMention is a complex type with no base type, but in the clean metadata, we seem to be adding a base type of entity to it. This leads to a property conflict since both entity and chatMessageMention have an id property of different types, a string for entity and int32 for chatMessageMention.

Live Metadata

image

Clean Metadata

image

The same applies to the clean v1.0 metadata.

See microsoftgraph/msgraph-beta-sdk-dotnet#110 (comment)

Remove ContainsTarget on EducationAssignment Rubric Navigation Property

ContainsTarget=True on EducationAssignment's rubric Navigation Property is not correct. This is due to a bug in AGS where it fails if the metadata has containstarget=false, so for now the metadata has to be incorrect.

The conclusion is therefore to make it one of the xslt transform rules that are mapped onto the raw Graph metadata
AB#10264

OData.Type removal generation hints

Design an annotation mechanism for disabling generation of the odata.type initialization code. Let's track where this needs to happen:

  • User properties backed by SPO.
  • Anything to do with Teams. Need to investigate.

This is supposed to be a temporary low cost fix to unblock customers as it is the responsibility of workload APIs to ignore instance attributes they don't support. We need to investigate whether VIPR and Typewriter will easily support this to determine actual cost.
AB#7454

Problems in current published v1.0 and beta metadata on 2020-09-21

When attempting to generate code from the current state of metadata from the service metadata urls on 2020-09-21, I found the following problems:

v1.0:

  • Entities without keys:
    microsoft.graph.policyRoot
    microsoft.graph.educationRoot
    microsoft.graph.cloudCommunications
    microsoft.graph.planner
    microsoft.graph.security
    microsoft.graph.appCatalogs
    microsoft.graph.teamwork
    microsoft.graph.informationProtection

beta:

  • Entities without keys:
    microsoft.graph.auditLogRoot
    microsoft.graph.policyRoot
    microsoft.graph.bitlocker
    microsoft.graph.compliance
    microsoft.graph.identityContainer
    microsoft.graph.trustFramework
    microsoft.graph.directory
    microsoft.graph.roleManagement
    microsoft.graph.educationRoot
    microsoft.graph.identityGovernance
    microsoft.graph.identityProtectionRoot
    microsoft.graph.officeConfiguration
    microsoft.graph.financials
    microsoft.graph.planner
    microsoft.graph.print
    microsoft.graph.security
    microsoft.graph.commsApplication
    microsoft.graph.external
    microsoft.graph.appCatalogs

The fix for all of these is to add the attribute BaseType="graph.entity" but of course that's for you guys to confirm. I notice that the current state of the metadata in this repository seems to have these issues fixed (I didn't check all of them). When will the new metadata be published?

BTW thanks for exposing this metadata repo! Just what I wanted (assuming that the Graph team address issues raised here!).

AB#7458

Restrict the expansion of select containment navigation properties

We want to start expanding all valid containment navigation properties. This PR helped us remove some of the invalid containments. However, the Files OpenAPI doc., generated by PowerShell to be processed by AutoREST for cmdlet generation is currently at ~10MB for the beta version. This is beyond AutoREST's file processing capability of ~6MB. We need to reduce the size of the Files OpenAPI doc. before we can fully release the process of expanding all containment navigation properties in the generated OpenAPI doc. We can do this by adding annotations to remove the indexability of the following navigation properties:

  • microsoft.graph.user/drive
  • microsoft.graph.group/drive
  • microsoft.graph.sharedDriveItem/site

Using the OpenAPI.NET.OData converter lib., adding these annotations should be useful in preventing expansion of these navigation properties. Restricting the expansion of these navigation properties will not lead to a breaking change, as they are currently not being expanded anyway in the converted OpenAPI document.

See below the Current vs Proposed changes snapshots. The operations highlighted in yellow are under the new expanded paths.

Current:

microsoft.graph.user/drives
image

microsoft.graph.group/drives
image

microsoft.graph.sharedDriveItem/site
image

Proposed:

microsoft.graph.user/drives
image

microsoft.graph.group/drives
image

microsoft.graph.sharedDriveItem/site
image

undocumented mandatory startDateTime/endDateTime query params on /calendarView

startDateTime & endDateTime not documented, but the service complains with 400 if their not present
https://docs.microsoft.com/en-us/graph/api/calendar-list-calendarview?view=graph-rest-1.0&tabs=http

I'm opening this issue here in hope that this is the feed for the api being shown via:
https://graphexplorerapi.azurewebsites.net/openapi?tags=me.calendar&openApiVersion=2&graphVersion=v1.0&format=json&style=PowerPlatform

A previous attempt to contribute is here: https://github.com/microsoftgraph/microsoft-graph-openapi/issues/12

AB#7459

Add ConsistencyLevel header for advanced queries

In order for SDKs such as PowerShell to support advanced queries, the CSDL needs to have a custom header annotation nested under a read restrictions on all entitySets that accept a consistencyLevel header.

AGS does not currently expose all readRestrictions annotations in the CSDL. As a workaround, we should add customHeader to the following entitySets via XSLT:

  • applications
  • administrativeUnits
  • contacts
  • devices
  • groups
  • servicePrincipals
  • users
 <EntitySet Name="users" EntityType="Microsoft.DirectoryServices.user">
              <Annotation Term="Org.OData.Capabilities.V1.ReadRestrictions">
                <Record>
                  <PropertyValue Property="CustomHeaders">
                    <Collection>
                      <Record>
                        <PropertyValue Property="Name" String="ConsistencyLevel" />
                        <PropertyValue Property="Description" String="Indicates the requested consistency level." />
                        <PropertyValue Property="DocumentationURL" String="https://docs.microsoft.com/en-us/graph/api/orgcontact-list?view=graph-rest-beta" />
                        <PropertyValue Property="Required" Bool="false" />
                        <PropertyValue Property="ExampleValues">
                          <Collection>
                            <Record>
                              <PropertyValue Property="Value" String="eventual" />
                              <PropertyValue Property="Description" String="$search and $count queries require the client to set the ConsistencyLevel HTTP header to 'eventual'." />
                            </Record>
                          </Collection>
                        </PropertyValue>
                      </Record>
                    </Collection>
                  </PropertyValue>
                </Record>
              </Annotation>
        </EntitySet>

https://developer.microsoft.com/en-us/microsoft-365/blogs/build-advanced-queries-with-count-filter-search-and-orderby/
AB#6355

'microsoft.substrateConnectors.externalGroup' could not be resolved by the model

Hi, am trying to create an external group, but this isn't working.

Reference Docs: https://docs.microsoft.com/en-us/graph/api/externalconnection-post-groups?view=graph-rest-beta&tabs=http
I have created a connection, schema with some properties. I need to create an externalGroup to restrict access to items for certain users.

I've tried this in postman for example,
POST https://graph.microsoft.com/beta/external/connections/now/groups ("now" is my connection id)

Request Body:

{
  "@odata.type": "#microsoft.graph.externalGroup",
  "id": "testgroup",
  "displayName": "Test Group",
  "description": "Test Group"
}

but it doesn't work, I get a 400 Bad Request error with following response Body
Response:

{
  "error": {
    "code": "InvalidRequest",
    "message": "The request is malformed or incorrect.",
    "innerError": {
      "code": "DeserializationError",
      "message": "A type named 'microsoft.substrateConnectors.externalGroup' could not be resolved by the model. When a model is available, each type name must resolve to a valid type.",
      "date": "2021-03-14T18:41:29",
      "request-id": "60af803c-30e3-4bd7-8d38-0e2fb45f0a0b",
      "client-request-id": "60af803c-30e3-4bd7-8d38-0e2fb45f0a0b"
    }
  }
}

Is this the right way to query this?

Similar Issue can be seen for externalGroupMembers as well. https://docs.microsoft.com/en-us/graph/api/externalgroup-post-members?view=graph-rest-beta&tabs=http

AB#8595

Duplicate "accept" action in v1.0 metadata breaks DevX API

Getting the latest v1.0 OpenAPI document from DevX API results in a duplicate key error for accept action.
Repro steps:

It looks like this change is coming from our XSLT transform step which adds an additional accept action that is bound to an event.

This is currently blocking the release of PR microsoftgraph/msgraph-sdk-powershell#519.
Related to microsoftgraph/microsoft-graph-devx-api#432.

\cc @MIchaelMainer, @zengin
AB#7828

ConsistencyLevel Header Should Be Added To DirectoryObjects EntitySet

ConsistencyLevel header should also be added to DirectoryObjects EntitySet :

 <EntitySet Name="directoryObjects" EntityType="microsoft.graph.directoryObject">
              <Annotation Term="Org.OData.Capabilities.V1.ReadRestrictions">
                <Record>
                  <PropertyValue Property="CustomHeaders">
                    <Collection>
                      <Record>
                        <PropertyValue Property="Name" String="ConsistencyLevel" />
                        <PropertyValue Property="Description" String="Indicates the requested consistency level." />
                        <PropertyValue Property="DocumentationURL" String="https://docs.microsoft.com/en-us/graph/api/orgcontact-list?view=graph-rest-beta" />
                        <PropertyValue Property="Required" Bool="false" />
                        <PropertyValue Property="ExampleValues">
                          <Collection>
                            <Record>
                              <PropertyValue Property="Value" String="eventual" />
                              <PropertyValue Property="Description" String="$search and $count queries require the client to set the ConsistencyLevel HTTP header to 'eventual'." />
                            </Record>
                          </Collection>
                        </PropertyValue>
                      </Record>
                    </Collection>
                  </PropertyValue>
                </Record>
              </Annotation>
        </EntitySet>

AB#6942

Remove ContainsTarget for select navigation properties

We need to remove the containment for the below navigation property paths:

microsoft.graph.listItem/driveItem
microsoft.graph.sharedDriveItem/driveItem
microsoft.graph.sharedDriveItem/root
microsoft.graph.sharedDriveItem/items
microsoft.graph.site/drive
microsoft.graph.site/drives
microsoft.graph.list/drive
microsoft.graph.onenotePage/parentNotebook
microsoft.graph.onenoteSection/parentNotebook
microsoft.graph.sectionGroup/parentNotebook
microsoft.graph.itemActivityOLD/driveItem
microsoft.graph.itemActivity/driveItem
microsoft.graph.accessPackage/incompatibleGroups

These lead to the generation of multiple redundant paths when converting from CSDL to OpenAPI using the OpenAPI.NET.OData converter lib.

Use transform to remove capability annotations from DirectoryObject type

The capability annotations that are limiting access to the DirectoryObject entity set are being applied to all derived types. This is causing valid capabilities to be removed. Capability annotations should be applied to where types are used and not on the type itself where possible. We should remove the capability annotations on DirectoryObject and as the workload to put them in the correct place.

Related: microsoftgraph/microsoft-graph-devx-api#611

/cc @ddyett
AB#10772

Add Custom XML Attribute to Limit Which Nav Properties Are Expanded

image

The attribute will be consumed by OpenAPI.NET.OData lib to limit the paths that are expanded. If a navigation property has Explode="false" and ContainsTarget="true", OpenAPI.NET.OData will only generate paths to access the nav property (collection and by-key). All paths after the nav property will be dropped.

Remove problematic `ContainsTarget=true` for some containment navigation properties

This PR in the OpenAPI.NET.OData conversion library will change the expansion logic for containment navigation properties. This means we will have an explosion of paths for containment navigation properties which were hitherto not being expanded. We need to remove the containments of some of the invalid ContainsTarget=true for the cleanMetadataWithDescriptionsAndAnnotationsbeta and cleanMetadataWithDescriptionsAndAnnotationsv1.0 files which the DevX API uses to render OpenAPI documents for PowerShell.

usgovernmentl4: GET /v1.0/directoryObjects/OID is missing the `@odata.id` field

As reported in hashicorp/terraform-provider-azuread#588

The v1.0 directoryObjects endpoint is missing the @odata.id field in the response. For example:

GET /v1.0/[REDACTED]/directoryObjects/[REDACTED] HTTP/1.1
Host: graph.microsoft.us
User-Agent: HashiCorp Terraform/1.0.7 (+https://www.terraform.io) Terraform Plugin SDK/2.7.0 terraform-provider-azuread/2.2.1 Hamilton (Go-http-client/1.1) pid-222c6c49-1b0a-5959-a213-6608f9eb8820
Accept: application/json
Content-Type: application/json; charset=utf-8
Accept-Encoding: gzip
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Cache-Control: no-cache
Client-Request-Id: 4dd395b2-8072-4190-8027-85bc6329bddd
Content-Type: application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
Date: Thu, 23 Sep 2021 13:21:27 GMT
Odata-Version: 4.0
Request-Id: 4dd395b2-8072-4190-8027-85bc6329bddd
Strict-Transport-Security: max-age=31536000
Vary: Accept-Encoding
X-Ms-Ags-Diagnostic: {"ServerInfo":{"DataCenter":"USGov Arizona","Slice":"E","Ring":"5","ScaleUnit":"000","RoleInstance":"PH1NEPF00001421"}}

{
  "@odata.context": "https://graph.microsoft.us/v1.0/$metadata#directoryObjects/$entity",
  "@odata.type": "#microsoft.graph.servicePrincipal",
  "id": "[REDACTED]",
  "deletedDateTime": null,
  "accountEnabled": true,
  "alternativeNames": [],
  "appDisplayName": "[REDACTED]",
  "appDescription": null,
  "appId": "[REDACTED]",
  "applicationTemplateId": null,
  "appOwnerOrganizationId": "[REDACTED]",
  "appRoleAssignmentRequired": false,
  "createdDateTime": "2020-12-04T14:48:53Z",
  "description": null,
  "disabledByMicrosoftStatus": null,
  "displayName": "[REDACTED]",
  "homepage": null,
  "loginUrl": null,
  "logoutUrl": null,
  "notes": null,
  "notificationEmailAddresses": [],
  "preferredSingleSignOnMode": null,
  "preferredTokenSigningKeyThumbprint": null,
  "replyUrls": [],
  "resourceSpecificApplicationPermissions": [],
  "samlSingleSignOnSettings": null,
  "servicePrincipalNames": [
    "[REDACTED]"
  ],
  "servicePrincipalType": "Application",
  "signInAudience": "AzureADMyOrg",
  "tags": [
    "WindowsAzureActiveDirectoryIntegratedApp"
  ],
  "tokenEncryptionKeyId": null,
  "verifiedPublisher": {
    "displayName": null,
    "verifiedPublisherId": null,
    "addedDateTime": null
  },
  "addIns": [],
  "appRoles": [],
  "info": {
    "logoUrl": null,
    "marketingUrl": null,
    "privacyStatementUrl": null,
    "supportUrl": null,
    "termsOfServiceUrl": null
  },
  "keyCredentials": [],
  "oauth2PermissionScopes": [],
  "passwordCredentials": []
}

Add MS-APP-ACTS-AS to the CSDL metadata as a custom header

At the moment when working with powershell, we are explicitly declaring headers in the service schema. One ends up getting a service exception ("code":"Forbidden","message":"MS-APP-ACTS-AS header needs to be set for application context requests.") when using the powershell SDK for commands like Get-MgTeamScheduleSwapShiftChangeRequest.

[Breaking Change] Revert deleting workbooks entity set

This update to the metadata that happened on 20th July 2021 removed the workbooks entity set. This caused the generation of multiple paths due to the expansion of navigation property paths of type driveItem during conversion of the CSDL to OpenAPI by the Microsoft.OpenApi.OData lib. v1.0.8 used by the DevX API. This lead to service unavailability in the API due to memory over-utilisation.
The workbooks entity set needs to be reinstated.
AB#10770

ContainsTarget is not true on these navigation properties

TODO: remove containsTarget

<EntityType Name="onenotePage" BaseType="graph.onenoteEntitySchemaObjectModel" HasStream="true">
<Property Name="title" Type="Edm.String"/>
<Property Name="createdByAppId" Type="Edm.String"/>
<Property Name="links" Type="graph.pageLinks"/>
<Property Name="contentUrl" Type="Edm.String"/>
<Property Name="content" Type="Edm.Stream"/>
<Property Name="lastModifiedDateTime" Type="Edm.DateTimeOffset"/>
<Property Name="level" Type="Edm.Int32"/>
<Property Name="order" Type="Edm.Int32"/>
<Property Name="userTags" Type="Collection(Edm.String)"/>
<NavigationProperty Name="parentSection" Type="graph.onenoteSection" ContainsTarget="true"/>
<NavigationProperty Name="parentNotebook" Type="graph.notebook" ContainsTarget="true"/>
</EntityType>

AB#7457

Conditional Access Policy validation is broken

The sessionControls field of conditional access policies is validated incorrectly and inconsistently. When updating an existing conditional access policy to disable signInFrequency, sometimes this is not possible because the API does not accept the request. This happens with both the v1.0 and beta endpoints.

Example Request

PATCH /v1.0/57934744-b9ca-4e29-b5df-7578783cc31b/identity/conditionalAccess/policies/8eca5441-5a49-4273-b494-5171957fa938 HTTP/1.1
Host: graph.microsoft.com
User-Agent: HashiCorp Terraform/1.0.6 (+https://www.terraform.io) Terraform Plugin SDK/2.7.0 terraform-provider-azuread/dev Hamilton (Go-http-client/1.1) pid-222c6c49-1b0a-5959-a213-6608f9eb8820
Content-Length: 835
Accept: application/json
Authorization: Bearer [redacted]
Content-Type: application/json; charset=utf-8
Accept-Encoding: gzip

{
  "conditions": {
    "applications": {
      "includeApplications": [
        "All"
      ],
      "excludeApplications": [],
      "includeUserActions": []
    },
    "users": {
      "includeUsers": [
        "All"
      ],
      "excludeUsers": [
        "GuestsOrExternalUsers"
      ],
      "includeGroups": [],
      "excludeGroups": [],
      "includeRoles": [],
      "excludeRoles": []
    },
    "clientAppTypes": [
      "browser"
    ],
    "locations": {
      "includeLocations": [
        "All"
      ],
      "excludeLocations": []
    },
    "platforms": {
      "includePlatforms": [
        "all"
      ],
      "excludePlatforms": []
    },
    "signInRiskLevels": [],
    "userRiskLevels": []
  },
  "displayName": "acctest-CONPOLICY-210916131029741032",
  "grantControls": {
    "operator": "OR",
    "builtInControls": [
      "block"
    ],
    "customAuthenticationFactors": [],
    "termsOfUse": []
  },
  "id": "f0b63446-86b9-4f21-8668-5923f4d9db6e",
  "sessionControls": {
    "applicationEnforcedRestrictions": {
      "isEnabled": false
    },
    "cloudAppSecurity": {
      "isEnabled": false
    },
    "signInFrequency": {
      "isEnabled": false
    }
  },
  "state": "disabled"
}

400 Response

HTTP/1.1 400 Bad Request
Date: Thu, 16 Sep 2021 12:46:18 GMT
Content-Type: application/json
Cache-Control: no-cache
Transfer-Encoding: chunked
Content-Encoding: gzip
Vary: Accept-Encoding
Strict-Transport-Security: max-age=31536000
request-id: 33432bcb-7152-4559-a46a-72b6a86466de
client-request-id: 33432bcb-7152-4559-a46a-72b6a86466de
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"UK South","Slice":"E","Ring":"3","ScaleUnit":"000","RoleInstance":"LN2PEPF00003AC1"}}

{
  "error": {
    "code": "BadRequest",
    "message": "1019: SignInFrequency type is invalid. It must be a valid hour or day. For examples, please see API documentation at https://docs.microsoft.com/en-us/graph/api/conditionalaccesspolicy-update?view=graph-rest-1.0.",
    "innerError": {
      "date": "2021-09-16T12:46:18",
      "request-id": "33432bcb-7152-4559-a46a-72b6a86466de",
      "client-request-id": "33432bcb-7152-4559-a46a-72b6a86466de"
    }
  }
}

Note that this error only happens in some (as yet undetermined) circumstances, other times the same request is accepted without error:

Request

PATCH /v1.0/57934744-b9ca-4e29-b5df-7578783cc31b/identity/conditionalAccess/policies/9374b53d-7b5c-43b8-9d69-777db20ac896 HTTP/1.1
Host: graph.microsoft.com
User-Agent: HashiCorp Terraform/1.0.6 (+https://www.terraform.io) Terraform Plugin SDK/2.7.0 terraform-provider-azuread/dev Hamilton (Go-http-client/1.1) pid-222c6c49-1b0a-5959-a213-6608f9eb8820
Content-Length: 835
Accept: application/json
Authorization: Bearer [redacted]
Content-Type: application/json; charset=utf-8
Accept-Encoding: gzip

{
  "conditions": {
    "applications": {
      "includeApplications": [
        "All"
      ],
      "excludeApplications": [],
      "includeUserActions": []
    },
    "users": {
      "includeUsers": [
        "All"
      ],
      "excludeUsers": [
        "GuestsOrExternalUsers"
      ],
      "includeGroups": [],
      "excludeGroups": [],
      "includeRoles": [],
      "excludeRoles": []
    },
    "clientAppTypes": [
      "browser"
    ],
    "locations": {
      "includeLocations": [
        "All"
      ],
      "excludeLocations": []
    },
    "platforms": {
      "includePlatforms": [
        "all"
      ],
      "excludePlatforms": []
    },
    "signInRiskLevels": [],
    "userRiskLevels": []
  },
  "displayName": "acctest-CONPOLICY-210916133840745958",
  "grantControls": {
    "operator": "OR",
    "builtInControls": [
      "block"
    ],
    "customAuthenticationFactors": [],
    "termsOfUse": []
  },
  "id": "ac7412c6-bfdc-4d3b-9ef2-04a2e51f7c24",
  "sessionControls": {
    "applicationEnforcedRestrictions": {
      "isEnabled": false
    },
    "cloudAppSecurity": {
      "isEnabled": false
    },
    "signInFrequency": {
      "isEnabled": false
    }
  },
  "state": "disabled"
}

204 Response

HTTP/1.1 204 No Content
Date: Thu, 16 Sep 2021 12:43:13 GMT
Content-Length: 0
Cache-Control: no-cache
Strict-Transport-Security: max-age=31536000
request-id: e699dce6-122f-4be9-9130-5a4bf79f8a3e
client-request-id: e699dce6-122f-4be9-9130-5a4bf79f8a3e
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"UK South","Slice":"E","Ring":"3","ScaleUnit":"000","RoleInstance":"LN2PEPF00003315"}}

Related to: hashicorp/terraform-provider-azuread#569

Where to report service metadata problems?

I've noticed a number of issues with Graph v1.0 and beta metadata over the last few months (many still remain). I think Microsoft needs a proper discussion point about the metadata specifically. So the latest has appeared in the beta metadata in the last few days and that is that in the EntityContainer there are conflicting members:

<EntitySet Name="settings" EntityType="microsoft.graph.directorySetting"/>
...
<Singleton Name="settings" Type="microsoft.graph.entitlementManagementSettings"/>

According to the odata docs:

Entity set, singleton, action import, and function import names MUST be unique within an entity container.

The official support page for Microsoft Graph has no spot where you can report an apparent bug. I appreciate I've a back channel through this project but it doesn't seem like the right spot. I'll cross-post this on StackOverflow I suppose.

Any suggestions on where to report this?

Add $ref to externalSponsors and internalSponsors

$ref should be added to externalSponsors and internalSponsors in Entitlement Management connected organizations for POST and DELETE.

e.g.
POST /identityGovernance/entitlementManagement/connectedOrganizations/{id}/externalSponsors should be POST /identityGovernance/entitlementManagement/connectedOrganizations/{id}/externalSponsors/$ref

See docs https://docs.microsoft.com/en-us/graph/api/connectedorganization-post-externalsponsors?view=graph-rest-beta&tabs=http.

Related to microsoftgraph/msgraph-sdk-powershell#516.

AB#7825

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.