Update all the docs and fix the PoliCheck complain

This commit is contained in:
Sam Xu 2020-01-14 16:42:41 -08:00
parent b6f952e08e
commit 14be0b681d
12 changed files with 18948 additions and 30634 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -294,26 +294,30 @@ namespace Microsoft.OpenApi.OData.Edm
{
continue;
}
var firstEntityType = bindingType.AsEntity().EntityDefinition();
var allEntitiesForOperation= new List<IEdmEntityType>(){ firstEntityType };
System.Func<IEdmNavigationSource, bool> filter = (z) =>
z.EntityType() != firstEntityType &&
z.EntityType().FindAllBaseTypes().Contains(firstEntityType);
//Search all EntitySets
allEntitiesForOperation.AddRange(
_model.EntityContainer.EntitySets()
.Where(filter).Select(x => x.EntityType())
);
//Search all singletons
allEntitiesForOperation.AddRange(
_model.EntityContainer.Singletons()
.Where(filter).Select(x => x.EntityType())
);
allEntitiesForOperation = allEntitiesForOperation.Distinct().ToList();
foreach (var bindingEntityType in allEntitiesForOperation)
{
// 1. Search for corresponding navigation source path
if (AppendBoundOperationOnNavigationSourcePath(edmOperation, isCollection, bindingEntityType))
{

View file

@ -89,7 +89,7 @@ namespace Microsoft.OpenApi.OData.Generator.Tests
Assert.Contains("/Accounts", paths.Keys);
Assert.Contains("/Accounts/{id}", paths.Keys);
Assert.Contains("/Accounts/{id}/Attachments()", paths.Keys);
Assert.Contains("/Accounts/{id}/AttachmentsAdd", paths.Keys);
Assert.Contains("/Accounts/{id}/AttachmentsAdd", paths.Keys);
}
}
}

View file

@ -51,6 +51,7 @@ namespace Microsoft.OpenApi.OData.Operation.Tests
Assert.Equal(2, operation.Responses.Count);
Assert.Equal(new string[] { "200", "default" }, operation.Responses.Select(e => e.Key));
}
[Fact]
public void CreateOperationForEdmFunctionReturnsCorrectOperationHierarhicalClass()
{

View file

@ -1,48 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
<edmx:DataServices>
<Schema Namespace="Microsoft.OData.Service.Sample.Contract" xmlns="http://docs.oasis-open.org/odata/ns/edm">
<EntityType Name="BaseEntityApiModel" Abstract="true">
<Key>
<PropertyRef Name="id" />
</Key>
<Property Name="id" Type="Edm.Int64" Nullable="false" />
<Property Name="name" Type="Edm.String" />
<Property Name="description" Type="Edm.String" />
</EntityType>
<ComplexType Name="AttachmentApiModel" BaseType="System.Object">
<Property Name="id" Type="Edm.Int64" />
<Property Name="name" Type="Edm.String" />
<Property Name="objId" Type="Edm.Int64" />
<Property Name="mime" Type="Edm.String" />
<Property Name="extension" Type="Edm.String" />
<Property Name="size" Type="Edm.Int64" />
<Property Name="type" Type="Edm.String" />
<Property Name="date" Type="Edm.DateTimeOffset" />
<Property Name="comment" Type="Edm.String" />
</ComplexType>
<EntityType Name="AccountApiModel" BaseType="Microsoft.OData.Service.Sample.Contract.BaseEntityApiModel">
<Property Name="priority" Type="Edm.Int32" />
<Property Name="numberFilial" Type="Edm.String" />
<Property Name="numberCustomer" Type="Edm.String" />
<Property Name="calculateVar" Type="Edm.Boolean" />
<Property Name="lastCloseDate" Type="Edm.DateTimeOffset" />
</EntityType>
</Schema>
<Schema Namespace="Default" xmlns="http://docs.oasis-open.org/odata/ns/edm">
<Function Name="Attachments" IsBound="true">
<Parameter Name="bindingParameter" Type="Microsoft.OData.Service.Sample.Contract.BaseEntityApiModel" />
<ReturnType Type="Collection(Microsoft.OData.Service.Sample.Contract.AttachmentApiModel)" />
</Function>
<edmx:DataServices>
<Schema Namespace="Microsoft.OData.Service.Sample.Contract" xmlns="http://docs.oasis-open.org/odata/ns/edm">
<EntityType Name="BaseEntityApiModel" Abstract="true">
<Key>
<PropertyRef Name="id" />
</Key>
<Property Name="id" Type="Edm.Int64" Nullable="false" />
<Property Name="name" Type="Edm.String" />
<Property Name="description" Type="Edm.String" />
</EntityType>
<ComplexType Name="AttachmentApiModel" BaseType="System.Object">
<Property Name="id" Type="Edm.Int64" />
<Property Name="name" Type="Edm.String" />
<Property Name="objId" Type="Edm.Int64" />
<Property Name="mime" Type="Edm.String" />
<Property Name="extension" Type="Edm.String" />
<Property Name="size" Type="Edm.Int64" />
<Property Name="type" Type="Edm.String" />
<Property Name="date" Type="Edm.DateTimeOffset" />
<Property Name="comment" Type="Edm.String" />
</ComplexType>
<EntityType Name="AccountApiModel" BaseType="Microsoft.OData.Service.Sample.Contract.BaseEntityApiModel">
<Property Name="priority" Type="Edm.Int32" />
<Property Name="numberFilial" Type="Edm.String" />
<Property Name="numberCustomer" Type="Edm.String" />
<Property Name="calculateVar" Type="Edm.Boolean" />
<Property Name="lastCloseDate" Type="Edm.DateTimeOffset" />
</EntityType>
</Schema>
<Schema Namespace="Default" xmlns="http://docs.oasis-open.org/odata/ns/edm">
<Function Name="Attachments" IsBound="true">
<Parameter Name="bindingParameter" Type="Microsoft.OData.Service.Sample.Contract.BaseEntityApiModel" />
<ReturnType Type="Collection(Microsoft.OData.Service.Sample.Contract.AttachmentApiModel)" />
</Function>
<Action Name="AttachmentsAdd" IsBound="true">
<Parameter Name="bindingParameter" Type="Microsoft.OData.Service.Sample.Contract.BaseEntityApiModel"/>
<Parameter Name="comment" Type="Edm.String"/>
<Parameter Name="file" Type="Edm.String"/>
</Action>
<EntityContainer Name="Container">
<EntitySet Name="Accounts" EntityType="Microsoft.OData.Service.Sample.Contract.AccountApiModel">
<EntityContainer Name="Container">
<EntitySet Name="Accounts" EntityType="Microsoft.OData.Service.Sample.Contract.AccountApiModel">
</EntitySet>
</EntityContainer>
</Schema>
</edmx:DataServices>
</Schema>
</edmx:DataServices>
</edmx:Edmx>

View file

@ -2050,7 +2050,7 @@
<Property Name="businessPhones" Type="Collection(Edm.String)" Nullable="false" Unicode="false" />
<Property Name="city" Type="Edm.String" Unicode="false" />
<Property Name="companyName" Type="Edm.String" Unicode="false" />
<Property Name="country" Type="Edm.String" Unicode="false" />
<Property Name="countryOrRegion" Type="Edm.String" Unicode="false" />
<Property Name="department" Type="Edm.String" Unicode="false" />
<Property Name="deviceKeys" Type="Collection(microsoft.graph.deviceKey)" Nullable="false" />
<Property Name="displayName" Type="Edm.String" Unicode="false" />
@ -2724,7 +2724,7 @@
<Property Name="assignedPlans" Type="Collection(microsoft.graph.assignedPlan)" Nullable="false" />
<Property Name="businessPhones" Type="Collection(Edm.String)" Nullable="false" Unicode="false" />
<Property Name="city" Type="Edm.String" Unicode="false" />
<Property Name="country" Type="Edm.String" Unicode="false" />
<Property Name="countryOrRegion" Type="Edm.String" Unicode="false" />
<Property Name="countryLetterCode" Type="Edm.String" Unicode="false" />
<Property Name="displayName" Type="Edm.String" Unicode="false" />
<Property Name="isMultipleDataLocationsForServicesEnabled" Type="Edm.Boolean" />
@ -2918,7 +2918,7 @@
<Property Name="businessPhones" Type="Collection(Edm.String)" Nullable="false" Unicode="false" />
<Property Name="city" Type="Edm.String" Unicode="false" />
<Property Name="companyName" Type="Edm.String" Unicode="false" />
<Property Name="country" Type="Edm.String" Unicode="false" />
<Property Name="countryOrRegion" Type="Edm.String" Unicode="false" />
<Property Name="department" Type="Edm.String" Unicode="false" />
<Property Name="displayName" Type="Edm.String" Unicode="false" />
<Property Name="givenName" Type="Edm.String" Unicode="false" />
@ -20381,22 +20381,22 @@
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates whether or not to block auto fill." />
</Annotations>
<Annotations Target="microsoft.graph.windows10GeneralConfiguration/edgeBlocked">
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates whether or not to Block the user from using the Edge browser." />
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates whether or not to Block the user from using the Microsoft Edge browser." />
</Annotations>
<Annotations Target="microsoft.graph.windows10GeneralConfiguration/edgeCookiePolicy">
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates which cookies to block in the Edge browser." />
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates which cookies to block in the Microsoft Edge browser." />
</Annotations>
<Annotations Target="microsoft.graph.windows10GeneralConfiguration/edgeBlockDeveloperTools">
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates whether or not to block developer tools in the Edge browser." />
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates whether or not to block developer tools in the Microsoft Edge browser." />
</Annotations>
<Annotations Target="microsoft.graph.windows10GeneralConfiguration/edgeBlockSendingDoNotTrackHeader">
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates whether or not to Block the user from sending the do not track header." />
</Annotations>
<Annotations Target="microsoft.graph.windows10GeneralConfiguration/edgeBlockExtensions">
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates whether or not to block extensions in the Edge browser." />
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates whether or not to block extensions in the Microsoft Edge browser." />
</Annotations>
<Annotations Target="microsoft.graph.windows10GeneralConfiguration/edgeBlockInPrivateBrowsing">
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates whether or not to block InPrivate browsing on corporate networks, in the Edge browser." />
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates whether or not to block InPrivate browsing on corporate networks, in the Microsoft Edge browser." />
</Annotations>
<Annotations Target="microsoft.graph.windows10GeneralConfiguration/edgeBlockJavaScript">
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates whether or not to Block the user from using JavaScript." />
@ -20414,7 +20414,7 @@
<Annotation Term="Org.OData.Core.V1.Description" String="Clear browsing data on exiting Microsoft Edge." />
</Annotations>
<Annotations Target="microsoft.graph.windows10GeneralConfiguration/edgeAllowStartPagesModification">
<Annotation Term="Org.OData.Core.V1.Description" String="Allow users to change Start pages on Edge. Use the EdgeHomepageUrls to specify the Start pages that the user would see by default when they open Edge." />
<Annotation Term="Org.OData.Core.V1.Description" String="Allow users to change Start pages on Microsoft Edge. Use the EdgeHomepageUrls to specify the Start pages that the user would see by default when they open Microsoft Edge." />
</Annotations>
<Annotations Target="microsoft.graph.windows10GeneralConfiguration/edgeDisableFirstRunPage">
<Annotation Term="Org.OData.Core.V1.Description" String="Block the Microsoft web page that opens on the first use of Microsoft Edge. This policy allows enterprises, like those enrolled in zero emissions configurations, to block this page." />
@ -20633,7 +20633,7 @@
<Annotation Term="Org.OData.Core.V1.Description" String="Enabling this policy hides the user tile from appearing in the start menu." />
</Annotations>
<Annotations Target="microsoft.graph.windows10GeneralConfiguration/startMenuLayoutEdgeAssetsXml">
<Annotation Term="Org.OData.Core.V1.Description" String="This policy setting allows you to import Edge assets to be used with startMenuLayoutXml policy. Start layout can contain secondary tile from Edge app which looks for Edge local asset file. Edge local asset would not exist and cause Edge secondary tile to appear empty in this case. This policy only gets applied when startMenuLayoutXml policy is modified. The value should be a UTF-8 Base64 encoded byte array." />
<Annotation Term="Org.OData.Core.V1.Description" String="This policy setting allows you to import Microsoft Edge assets to be used with startMenuLayoutXml policy. Start layout can contain secondary tile from Microsoft Edge app which looks for Microsoft Edge local asset file. Microsoft Edge local asset would not exist and cause Microsoft Edge secondary tile to appear empty in this case. This policy only gets applied when startMenuLayoutXml policy is modified. The value should be a UTF-8 Base64 encoded byte array." />
</Annotations>
<Annotations Target="microsoft.graph.windows10GeneralConfiguration/startMenuLayoutXml">
<Annotation Term="Org.OData.Core.V1.Description" String="Allows admins to override the default Start menu layout and prevents the user from changing it. The layout is modified by specifying an XML file based on a layout modification schema. XML needs to be in a UTF8 encoded byte array format." />
@ -20792,7 +20792,7 @@
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates whether or not to Block the user from using the search suggestions in the address bar." />
</Annotations>
<Annotations Target="microsoft.graph.windows10GeneralConfiguration/edgeBlockSendingIntranetTrafficToInternetExplorer">
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates whether or not to Block the user from sending Intranet traffic to Internet Explorer from Edge." />
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates whether or not to Block the user from sending Intranet traffic to Internet Explorer from Microsoft Edge." />
</Annotations>
<Annotations Target="microsoft.graph.windows10GeneralConfiguration/edgeRequireSmartScreen">
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates whether or not to Require the user to use the smart screen filter." />
@ -20801,16 +20801,16 @@
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates the enterprise mode site list location. Could be a local file, local network or http location." />
</Annotations>
<Annotations Target="microsoft.graph.windows10GeneralConfiguration/edgeFirstRunUrl">
<Annotation Term="Org.OData.Core.V1.Description" String="The first run URL for when Edge browser is opened for the first time." />
<Annotation Term="Org.OData.Core.V1.Description" String="The first run URL for when Microsoft Edge browser is opened for the first time." />
</Annotations>
<Annotations Target="microsoft.graph.windows10GeneralConfiguration/edgeSearchEngine">
<Annotation Term="Org.OData.Core.V1.Description" String="Allows IT admins to set a default search engine for MDM-Controlled devices. Users can override this and change their default search engine provided the AllowSearchEngineCustomization policy is not set." />
</Annotations>
<Annotations Target="microsoft.graph.windows10GeneralConfiguration/edgeHomepageUrls">
<Annotation Term="Org.OData.Core.V1.Description" String="The list of URLs for homepages shodwn on MDM-enrolled devices on Edge browser." />
<Annotation Term="Org.OData.Core.V1.Description" String="The list of URLs for homepages shodwn on MDM-enrolled devices on Microsoft Edge browser." />
</Annotations>
<Annotations Target="microsoft.graph.windows10GeneralConfiguration/edgeBlockAccessToAboutFlags">
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates whether or not to prevent access to about flags on Edge browser." />
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates whether or not to prevent access to about flags on Microsoft Edge browser." />
</Annotations>
<Annotations Target="microsoft.graph.windows10GeneralConfiguration/smartScreenBlockPromptOverride">
<Annotation Term="Org.OData.Core.V1.Description" String="Indicates whether or not users can override SmartScreen Filter warnings about potentially malicious websites." />