Skip to content

Commit d0e0bcc

Browse files
Address review comments
1 parent 70728e1 commit d0e0bcc

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiInfoGenerator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ private static Dictionary<string, IOpenApiExtension> GetExtensions(this ODataCon
103103
{
104104
Debug.Assert(context != null);
105105

106-
if (context.Settings.ShowAssemblyInfo)
106+
if (context.Settings.IncludeAssemblyInfo)
107107
{
108108
return new Dictionary<string, IOpenApiExtension>()
109109
{
110110
{
111-
"x-generatedBy",
111+
"x-ms-generated-by",
112112
new OpenApiObject
113113
{
114-
{ "toolName", new OpenApiString("OpenAPI.NET.CSDL") },
114+
{ "toolName", new OpenApiString("Microsoft.OpenApi.OData") },
115115
{ "toolVersion", new OpenApiString(Assembly.GetExecutingAssembly().GetName().Version.ToString()) }
116116
}
117117
}

src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<TargetFrameworks>netstandard2.0</TargetFrameworks>
1616
<PackageId>Microsoft.OpenApi.OData</PackageId>
1717
<SignAssembly>true</SignAssembly>
18-
<Version>1.2.0-preview2</Version>
18+
<Version>1.2.0-preview3</Version>
1919
<Description>This package contains the codes you need to convert OData CSDL to Open API Document of Model.</Description>
2020
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
2121
<PackageTags>Microsoft OpenApi OData EDM</PackageTags>

src/Microsoft.OpenApi.OData.Reader/OpenApiConvertSettings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public string PathPrefix
279279
/// Gets/Sets a value indicating whether to show the version of the assembly used for generating
280280
/// Open API document
281281
/// </summary>
282-
public bool ShowAssemblyInfo { get; set; } = true;
282+
public bool IncludeAssemblyInfo { get; set; } = true;
283283

284284
/// <summary>
285285
/// Get/Sets a dictionary containing a mapping of HTTP methods to custom link relation types
@@ -341,7 +341,7 @@ internal OpenApiConvertSettings Clone()
341341
AppendBoundOperationsOnDerivedTypeCastSegments = this.AppendBoundOperationsOnDerivedTypeCastSegments,
342342
UseSuccessStatusCodeRange = this.UseSuccessStatusCodeRange,
343343
EnableCount = this.EnableCount,
344-
ShowAssemblyInfo = this.ShowAssemblyInfo,
344+
IncludeAssemblyInfo = this.IncludeAssemblyInfo,
345345
RefBaseCollectionPaginationCountResponse = this.RefBaseCollectionPaginationCountResponse
346346
};
347347

src/Microsoft.OpenApi.OData.Reader/PublicAPI.Unshipped.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ Microsoft.OpenApi.OData.OpenApiConvertSettings.ExpandDerivedTypesNavigationPrope
1515
Microsoft.OpenApi.OData.OpenApiConvertSettings.ExpandDerivedTypesNavigationProperties.set -> void
1616
Microsoft.OpenApi.OData.OpenApiConvertSettings.CustomXMLAttributesMapping.get -> System.Collections.Generic.Dictionary<string, string>
1717
Microsoft.OpenApi.OData.OpenApiConvertSettings.CustomXMLAttributesMapping.set -> void
18+
Microsoft.OpenApi.OData.OpenApiConvertSettings.IncludeAssemblyInfo.get -> bool
19+
Microsoft.OpenApi.OData.OpenApiConvertSettings.IncludeAssemblyInfo.set -> void
1820
Microsoft.OpenApi.OData.OpenApiConvertSettings.RefBaseCollectionPaginationCountResponse.get -> bool
1921
Microsoft.OpenApi.OData.OpenApiConvertSettings.RefBaseCollectionPaginationCountResponse.set -> void
2022
Microsoft.OpenApi.OData.OpenApiConvertSettings.RequireRestrictionAnnotationsToGenerateComplexPropertyPaths.get -> bool
2123
Microsoft.OpenApi.OData.OpenApiConvertSettings.RequireRestrictionAnnotationsToGenerateComplexPropertyPaths.set -> void
22-
Microsoft.OpenApi.OData.OpenApiConvertSettings.ShowAssemblyInfo.get -> bool
23-
Microsoft.OpenApi.OData.OpenApiConvertSettings.ShowAssemblyInfo.set -> void
2424
Microsoft.OpenApi.OData.OpenApiConvertSettings.ShowExternalDocs.get -> bool
2525
Microsoft.OpenApi.OData.OpenApiConvertSettings.ShowExternalDocs.set -> void
2626
Microsoft.OpenApi.OData.OpenApiConvertSettings.UseSuccessStatusCodeRange.get -> bool

test/Microsoft.OpenAPI.OData.Reader.Tests/EdmModelOpenApiExtensionsTest.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void EmptyEdmModelToOpenApiJsonWorks(OpenApiSpecVersion specVersion)
4040
IEdmModel model = EdmModelHelper.EmptyModel;
4141
var openApiConvertSettings = new OpenApiConvertSettings();
4242
openApiConvertSettings.OpenApiSpecVersion = specVersion;
43-
openApiConvertSettings.ShowAssemblyInfo = false;
43+
openApiConvertSettings.IncludeAssemblyInfo = false;
4444

4545
// Act
4646
string json = WriteEdmModelAsOpenApi(model, OpenApiFormat.Json, openApiConvertSettings);
@@ -66,7 +66,7 @@ public void EmptyEdmModelToOpenApiYamlWorks(OpenApiSpecVersion specVersion)
6666
IEdmModel model = EdmModelHelper.EmptyModel;
6767
var openApiConvertSettings = new OpenApiConvertSettings();
6868
openApiConvertSettings.OpenApiSpecVersion = specVersion;
69-
openApiConvertSettings.ShowAssemblyInfo = false;
69+
openApiConvertSettings.IncludeAssemblyInfo = false;
7070

7171
// Act
7272
string yaml = WriteEdmModelAsOpenApi(model, OpenApiFormat.Yaml, openApiConvertSettings);
@@ -94,7 +94,7 @@ public void BasicEdmModelToOpenApiJsonWorks(OpenApiSpecVersion specVersion)
9494
{
9595
OpenApiSpecVersion = specVersion,
9696
ShowSchemaExamples = true, // test for schema examples
97-
ShowAssemblyInfo = false
97+
IncludeAssemblyInfo = false
9898
};
9999

100100
// Act
@@ -123,7 +123,7 @@ public void BasicEdmModelToOpenApiYamlWorks(OpenApiSpecVersion specVersion)
123123
{
124124
OpenApiSpecVersion = specVersion,
125125
ShowSchemaExamples = true,
126-
ShowAssemblyInfo = false
126+
IncludeAssemblyInfo = false
127127
};
128128

129129
// Act
@@ -153,7 +153,7 @@ public void MultipleSchemasEdmModelToOpenApiJsonWorks(OpenApiSpecVersion specVer
153153
OpenApiSpecVersion = specVersion,
154154
ShowLinks = true, // test Links
155155
ShowSchemaExamples = true,
156-
ShowAssemblyInfo = false
156+
IncludeAssemblyInfo = false
157157
};
158158

159159
// Act
@@ -183,7 +183,7 @@ public void MultipleSchemasEdmModelToOpenApiYamlWorks(OpenApiSpecVersion specVer
183183
OpenApiSpecVersion = specVersion,
184184
ShowLinks = true, // test Links
185185
ShowSchemaExamples = true,
186-
ShowAssemblyInfo = false
186+
IncludeAssemblyInfo = false
187187
};
188188

189189
// Act
@@ -218,7 +218,7 @@ public void TripServiceMetadataToOpenApiJsonWorks(OpenApiSpecVersion specVersion
218218
AddSingleQuotesForStringParameters = true,
219219
AddEnumDescriptionExtension = true,
220220
AppendBoundOperationsOnDerivedTypeCastSegments = true,
221-
ShowAssemblyInfo = false
221+
IncludeAssemblyInfo = false
222222
};
223223
// Act
224224
string json = WriteEdmModelAsOpenApi(model, OpenApiFormat.Json, settings);
@@ -253,7 +253,7 @@ public void TripServiceMetadataToOpenApiYamlWorks(OpenApiSpecVersion specVersion
253253
AddSingleQuotesForStringParameters = true,
254254
AddEnumDescriptionExtension = true,
255255
AppendBoundOperationsOnDerivedTypeCastSegments = true,
256-
ShowAssemblyInfo = false
256+
IncludeAssemblyInfo = false
257257
};
258258

259259
// Act

0 commit comments

Comments
 (0)