Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public static IList<OpenApiParameter> CreateKeyParameters(this ODataContext cont
Name = parameterNameMapping == null ? keyName: parameterNameMapping[keyName],
In = ParameterLocation.Path,
Required = true,
Description = "key: " + keyName + " of " + entityType.Name,
Description = $"The unique identifier of {entityType.Name}",
Schema = context.CreateEdmTypeSchema(keys.First().Type)
};

Expand All @@ -199,7 +199,7 @@ public static IList<OpenApiParameter> CreateKeyParameters(this ODataContext cont
parameterNameMapping[keyProperty.Name],// By design: not prefix with type name if enable type name prefix
In = ParameterLocation.Path,
Required = true,
Description = "key: " + keyProperty.Name + " of " + entityType.Name,
Description = $"Property in multi-part unique identifier of {entityType.Name}",
Schema = context.CreateEdmTypeSchema(keyProperty.Type)
};

Expand Down Expand Up @@ -229,7 +229,7 @@ private static IList<OpenApiParameter> CreateAlternateKeyParameters(ODataContext
{
Name = alternateKey.First().Key,
In = ParameterLocation.Path,
Description = $"Alternate key: {alternateKey.First().Value.Name} of {entityType.Name}",
Description = $"Alternate key of {entityType.Name}",
Schema = context.CreateEdmTypeSchema(alternateKey.First().Value.Type),
Required = true
}
Expand All @@ -244,7 +244,7 @@ private static IList<OpenApiParameter> CreateAlternateKeyParameters(ODataContext
{
Name = compositekey.Key,
In = ParameterLocation.Path,
Description = $"Composite alternate key: {compositekey.Value.Name} of {entityType.Name}",
Description = $"Property in multi-part alternate key of {entityType.Name}",
Schema = context.CreateEdmTypeSchema(compositekey.Value.Type),
Required = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,13 @@
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<PackageId>Microsoft.OpenApi.OData</PackageId>
<SignAssembly>true</SignAssembly>
<Version>1.2.0</Version>
<Version>1.3.0-preview1</Version>
<Description>This package contains the codes you need to convert OData CSDL to Open API Document of Model.</Description>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageTags>Microsoft OpenApi OData EDM</PackageTags>
<RepositoryUrl>https://github.com/Microsoft/OpenAPI.NET.OData</RepositoryUrl>
<PackageReleaseNotes>
- Use convert setting to toggle between referencing @odata.count and @odata.nextLink #282
- Fixes URL Path parameters of type datetime generated as strings with quotes #262
- Set assembly version used for conversion in OpenApiInfo object #208
- Adds create and update operations to non-containment navigation properties when restrictions annotations are explicitly set to true #265
- Generate odata.nextLink and odata.deltaLink properties on delta functions response schemas #285
- Omits paths with PathItems without any operation #148
- Expands navigation properties of derived types only if declaring navigation property is a containment #269
- Adds custom parameters to $count and ODataTypeCast paths' Get operations #207
- Adds support for configuring the default value of derived types' @odata.type property #304
- Adds OData query parameters to $count endpoints #313
- Finds all the derived types for a schema element #84
- Add support for paths with alternate keys #120, #329
- Update key path parameter descriptions #309
</PackageReleaseNotes>
<AssemblyName>Microsoft.OpenApi.OData.Reader</AssemblyName>
<AssemblyOriginatorKeyFile>..\..\tool\Microsoft.OpenApi.OData.snk</AssemblyOriginatorKeyFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public void CreateKeyParametersForSingleKeyWorks(bool prefix)
expected = @"{
""name"": ""Customer-Id"",
""in"": ""path"",
""description"": ""key: Customer-Id of Customer"",
""description"": ""The unique identifier of Customer"",
""required"": true,
""schema"": {
""type"": ""string"",
Expand All @@ -204,7 +204,7 @@ public void CreateKeyParametersForSingleKeyWorks(bool prefix)
expected = @"{
""name"": ""Id"",
""in"": ""path"",
""description"": ""key: Id of Customer"",
""description"": ""The unique identifier of Customer"",
""required"": true,
""schema"": {
""type"": ""string"",
Expand Down Expand Up @@ -248,7 +248,7 @@ public void CreateKeyParametersForCompositeKeyWorks(bool prefix)
string expected = @"{
""name"": ""firstName"",
""in"": ""path"",
""description"": ""key: firstName of Customer"",
""description"": ""Property in multi-part unique identifier of Customer"",
""required"": true,
""schema"": {
""type"": ""string"",
Expand All @@ -264,7 +264,7 @@ public void CreateKeyParametersForCompositeKeyWorks(bool prefix)
expected = @"{
""name"": ""lastName"",
""in"": ""path"",
""description"": ""key: lastName of Customer"",
""description"": ""Property in multi-part unique identifier of Customer"",
""required"": true,
""schema"": {
""type"": ""string"",
Expand Down Expand Up @@ -304,7 +304,7 @@ public void CreateKeyParametersForAlternateKeyWithSinglePropertyWorks()
Assert.Equal(@"{
""name"": ""AltId"",
""in"": ""path"",
""description"": ""Alternate key: AlternateId of Customer"",
""description"": ""Alternate key of Customer"",
""required"": true,
""schema"": {
""type"": ""string"",
Expand Down Expand Up @@ -349,7 +349,7 @@ public void CreateKeyParametersForAlternateKeyWithMultiplePropertiesWorks()
Assert.Equal(@"{
""name"": ""AltId1"",
""in"": ""path"",
""description"": ""Composite alternate key: AlternateId1 of Customer"",
""description"": ""Property in multi-part alternate key of Customer"",
""required"": true,
""schema"": {
""type"": ""string"",
Expand All @@ -361,7 +361,7 @@ public void CreateKeyParametersForAlternateKeyWithMultiplePropertiesWorks()
Assert.Equal(@"{
""name"": ""AltId2"",
""in"": ""path"",
""description"": ""Composite alternate key: AlternateId2 of Customer"",
""description"": ""Property in multi-part alternate key of Customer"",
""required"": true,
""schema"": {
""type"": ""string"",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
{
"in": "path",
"name": "Name",
"description": "key: Name of City",
"description": "The unique identifier of City",
"required": true,
"type": "string",
"x-ms-docs-key-type": "City"
Expand Down Expand Up @@ -188,7 +188,7 @@
{
"in": "path",
"name": "Name",
"description": "key: Name of City",
"description": "The unique identifier of City",
"required": true,
"type": "string",
"x-ms-docs-key-type": "City"
Expand Down Expand Up @@ -223,7 +223,7 @@
{
"in": "path",
"name": "Name",
"description": "key: Name of City",
"description": "The unique identifier of City",
"required": true,
"type": "string",
"x-ms-docs-key-type": "City"
Expand Down Expand Up @@ -392,7 +392,7 @@
{
"in": "path",
"name": "Name",
"description": "key: Name of CountryOrRegion",
"description": "The unique identifier of CountryOrRegion",
"required": true,
"type": "string",
"x-ms-docs-key-type": "CountryOrRegion"
Expand Down Expand Up @@ -448,7 +448,7 @@
{
"in": "path",
"name": "Name",
"description": "key: Name of CountryOrRegion",
"description": "The unique identifier of CountryOrRegion",
"required": true,
"type": "string",
"x-ms-docs-key-type": "CountryOrRegion"
Expand Down Expand Up @@ -483,7 +483,7 @@
{
"in": "path",
"name": "Name",
"description": "key: Name of CountryOrRegion",
"description": "The unique identifier of CountryOrRegion",
"required": true,
"type": "string",
"x-ms-docs-key-type": "CountryOrRegion"
Expand Down Expand Up @@ -746,7 +746,7 @@
{
"in": "path",
"name": "UserName",
"description": "key: UserName of Person",
"description": "The unique identifier of Person",
"required": true,
"type": "string",
"x-ms-docs-key-type": "Person"
Expand Down Expand Up @@ -805,7 +805,7 @@
{
"in": "path",
"name": "UserName",
"description": "key: UserName of Person",
"description": "The unique identifier of Person",
"required": true,
"type": "string",
"x-ms-docs-key-type": "Person"
Expand Down Expand Up @@ -840,7 +840,7 @@
{
"in": "path",
"name": "UserName",
"description": "key: UserName of Person",
"description": "The unique identifier of Person",
"required": true,
"type": "string",
"x-ms-docs-key-type": "Person"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ paths:
parameters:
- in: path
name: Name
description: 'key: Name of City'
description: The unique identifier of City
required: true
type: string
x-ms-docs-key-type: City
Expand Down Expand Up @@ -123,7 +123,7 @@ paths:
parameters:
- in: path
name: Name
description: 'key: Name of City'
description: The unique identifier of City
required: true
type: string
x-ms-docs-key-type: City
Expand All @@ -147,7 +147,7 @@ paths:
parameters:
- in: path
name: Name
description: 'key: Name of City'
description: The unique identifier of City
required: true
type: string
x-ms-docs-key-type: City
Expand Down Expand Up @@ -253,7 +253,7 @@ paths:
parameters:
- in: path
name: Name
description: 'key: Name of CountryOrRegion'
description: The unique identifier of CountryOrRegion
required: true
type: string
x-ms-docs-key-type: CountryOrRegion
Expand Down Expand Up @@ -291,7 +291,7 @@ paths:
parameters:
- in: path
name: Name
description: 'key: Name of CountryOrRegion'
description: The unique identifier of CountryOrRegion
required: true
type: string
x-ms-docs-key-type: CountryOrRegion
Expand All @@ -315,7 +315,7 @@ paths:
parameters:
- in: path
name: Name
description: 'key: Name of CountryOrRegion'
description: The unique identifier of CountryOrRegion
required: true
type: string
x-ms-docs-key-type: CountryOrRegion
Expand Down Expand Up @@ -488,7 +488,7 @@ paths:
parameters:
- in: path
name: UserName
description: 'key: UserName of Person'
description: The unique identifier of Person
required: true
type: string
x-ms-docs-key-type: Person
Expand Down Expand Up @@ -529,7 +529,7 @@ paths:
parameters:
- in: path
name: UserName
description: 'key: UserName of Person'
description: The unique identifier of Person
required: true
type: string
x-ms-docs-key-type: Person
Expand All @@ -553,7 +553,7 @@ paths:
parameters:
- in: path
name: UserName
description: 'key: UserName of Person'
description: The unique identifier of Person
required: true
type: string
x-ms-docs-key-type: Person
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
{
"name": "Name",
"in": "path",
"description": "key: Name of City",
"description": "The unique identifier of City",
"required": true,
"schema": {
"type": "string"
Expand Down Expand Up @@ -213,7 +213,7 @@
{
"name": "Name",
"in": "path",
"description": "key: Name of City",
"description": "The unique identifier of City",
"required": true,
"schema": {
"type": "string"
Expand Down Expand Up @@ -252,7 +252,7 @@
{
"name": "Name",
"in": "path",
"description": "key: Name of City",
"description": "The unique identifier of City",
"required": true,
"schema": {
"type": "string"
Expand Down Expand Up @@ -435,7 +435,7 @@
{
"name": "Name",
"in": "path",
"description": "key: Name of CountryOrRegion",
"description": "The unique identifier of CountryOrRegion",
"required": true,
"schema": {
"type": "string"
Expand Down Expand Up @@ -504,7 +504,7 @@
{
"name": "Name",
"in": "path",
"description": "key: Name of CountryOrRegion",
"description": "The unique identifier of CountryOrRegion",
"required": true,
"schema": {
"type": "string"
Expand Down Expand Up @@ -543,7 +543,7 @@
{
"name": "Name",
"in": "path",
"description": "key: Name of CountryOrRegion",
"description": "The unique identifier of CountryOrRegion",
"required": true,
"schema": {
"type": "string"
Expand Down Expand Up @@ -828,7 +828,7 @@
{
"name": "UserName",
"in": "path",
"description": "key: UserName of Person",
"description": "The unique identifier of Person",
"required": true,
"schema": {
"type": "string"
Expand Down Expand Up @@ -900,7 +900,7 @@
{
"name": "UserName",
"in": "path",
"description": "key: UserName of Person",
"description": "The unique identifier of Person",
"required": true,
"schema": {
"type": "string"
Expand Down Expand Up @@ -939,7 +939,7 @@
{
"name": "UserName",
"in": "path",
"description": "key: UserName of Person",
"description": "The unique identifier of Person",
"required": true,
"schema": {
"type": "string"
Expand Down
Loading