Compare commits

...

4 commits

Author SHA1 Message Date
Vincent Biret 1bb0a3feca
- adds extension method to public api declaration 2021-11-25 14:26:11 -05:00
Vincent Biret faa8df1365
- fixes a bug where quotes were added to boool/number parameters
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
2021-11-24 12:54:06 -05:00
Vincent Biret f31925bd64
- reverts wrong test cases fro parameter quotes 2021-11-24 12:29:52 -05:00
Vincent Biret 9f6a60e5ad
- fixes #140 a bug where quotes would be missing in url templates 2021-11-24 12:02:25 -05:00
19 changed files with 122 additions and 86 deletions

View file

@ -0,0 +1,35 @@
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
// ------------------------------------------------------------
using Microsoft.OData.Edm;
namespace Microsoft.OpenApi.OData.Edm
{
/// <summary>
/// Extension methods for <see cref="IEdmType"/>
/// </summary>
public static class EdmTypeExtensions
{
/// <summary>
/// Determines wether a path parameter should be wrapped in quotes based on the type of the parameter.
/// </summary>
/// <param name="edmType">The type of the parameter.</param>
public static bool ShouldPathParameterBeQuoted(this IEdmType edmType)
{
if (edmType == null)
{
return false;
}
return edmType.TypeKind switch
{
EdmTypeKind.Enum => true,
EdmTypeKind.Primitive when edmType.IsString() || edmType.IsTemporal() => true,
_ => false,
};
}
}
}

View file

@ -77,13 +77,7 @@ namespace Microsoft.OpenApi.OData.Edm
} }
else else
{ {
IList<string> keyStrings = new List<string>(); return string.Join(",", KeyMappings.Select(x => x.Key + "='{" + x.Value + "}'"));
foreach (var key in KeyMappings)
{
keyStrings.Add(key.Key + "={" + key.Value + "}");
}
return String.Join(",", keyStrings);
} }
} }
@ -109,7 +103,8 @@ namespace Microsoft.OpenApi.OData.Edm
foreach (var keyProperty in keys) foreach (var keyProperty in keys)
{ {
string name = Utils.GetUniqueName(keyProperty.Name, parameters); string name = Utils.GetUniqueName(keyProperty.Name, parameters);
keyStrings.Add(keyProperty.Name + "={" + name + "}"); var quote = keyProperty.Type.Definition.ShouldPathParameterBeQuoted() ? "'" : string.Empty;
keyStrings.Add($"{keyProperty.Name}={quote}{{{name}}}{quote}");
} }
return String.Join(",", keyStrings); return String.Join(",", keyStrings);

View file

@ -83,7 +83,8 @@ namespace Microsoft.OpenApi.OData.Edm
} }
else else
{ {
return p.Name + "={" + uniqueName + "}"; var quote = p.Type.Definition.ShouldPathParameterBeQuoted() ? "'" : string.Empty;
return $"{p.Name}={quote}{{{uniqueName}}}{quote}";
} }
}))); })));

View file

@ -148,7 +148,8 @@ namespace Microsoft.OpenApi.OData.Edm
} }
else else
{ {
return p.Name + "={" + uniqueName + "}"; var quote = p.Type.Definition.ShouldPathParameterBeQuoted() ? "'" : string.Empty;
return p.Name + $"={quote}{{{uniqueName}}}{quote}";
} }
}))); })));

View file

@ -26,7 +26,7 @@ namespace Microsoft.OpenApi.OData.Edm
Singleton, Singleton,
/// <summary> /// <summary>
/// Represents an operation (function or action) path, for example: ~/users/NS.findRooms(roomId={roomId}) /// Represents an operation (function or action) path, for example: ~/users/NS.findRooms(roomId='{roomId}')
/// </summary> /// </summary>
Operation, Operation,

View file

@ -297,7 +297,7 @@ namespace Microsoft.OpenApi.OData.Edm
{ {
// Non-Contained // Non-Contained
// Single-Valued: ~/entityset/{key}/single-valued-Nav/$ref // Single-Valued: ~/entityset/{key}/single-valued-Nav/$ref
// Collection-valued: ~/entityset/{key}/collection-valued-Nav/$ref?$id ={navKey} // Collection-valued: ~/entityset/{key}/collection-valued-Nav/$ref?$id='{navKey}'
CreateRefPath(currentPath); CreateRefPath(currentPath);
if (targetsMany) if (targetsMany)

View file

@ -136,7 +136,8 @@ namespace Microsoft.OpenApi.OData.Generator
if (parameterNameMapping != null) if (parameterNameMapping != null)
{ {
parameter.Description = $"Usage: {edmParameter.Name}={{{parameterNameMapping[edmParameter.Name]}}}"; var quote = edmParameter.Type.Definition.ShouldPathParameterBeQuoted() ? "'" : string.Empty;
parameter.Description = $"Usage: {edmParameter.Name}={quote}{{{parameterNameMapping[edmParameter.Name]}}}{quote}";
} }
parameters.Add(parameter); parameters.Add(parameter);
@ -203,7 +204,8 @@ namespace Microsoft.OpenApi.OData.Generator
if (keySegment.KeyMappings != null) if (keySegment.KeyMappings != null)
{ {
parameter.Description = parameter.Description + $", {keyProperty.Name}={{{parameter.Name}}}"; var quote = keyProperty.Type.Definition.ShouldPathParameterBeQuoted() ? "'" : string.Empty;
parameter.Description += $", {keyProperty.Name}={quote}{{{parameter.Name}}}{quote}";
} }
parameter.Extensions.Add(Constants.xMsKeyType, new OpenApiString(entityType.Name)); parameter.Extensions.Add(Constants.xMsKeyType, new OpenApiString(entityType.Name));

View file

@ -3,6 +3,8 @@ abstract Microsoft.OpenApi.OData.Edm.ODataSegment.Identifier.get -> string
abstract Microsoft.OpenApi.OData.Edm.ODataSegment.Kind.get -> Microsoft.OpenApi.OData.Edm.ODataSegmentKind abstract Microsoft.OpenApi.OData.Edm.ODataSegment.Kind.get -> Microsoft.OpenApi.OData.Edm.ODataSegmentKind
Microsoft.OpenApi.OData.Common.Utils Microsoft.OpenApi.OData.Common.Utils
Microsoft.OpenApi.OData.Edm.EdmModelExtensions Microsoft.OpenApi.OData.Edm.EdmModelExtensions
Microsoft.OpenApi.OData.Edm.EdmTypeExtensions
static Microsoft.OpenApi.OData.Edm.EdmTypeExtensions.ShouldPathParameterBeQuoted(this Microsoft.OData.Edm.IEdmType edmType) -> bool
Microsoft.OpenApi.OData.Edm.IODataPathProvider Microsoft.OpenApi.OData.Edm.IODataPathProvider
Microsoft.OpenApi.OData.Edm.IODataPathProvider.CanFilter(Microsoft.OData.Edm.IEdmElement element) -> bool Microsoft.OpenApi.OData.Edm.IODataPathProvider.CanFilter(Microsoft.OData.Edm.IEdmElement element) -> bool
Microsoft.OpenApi.OData.Edm.IODataPathProvider.GetPaths(Microsoft.OData.Edm.IEdmModel model, Microsoft.OpenApi.OData.OpenApiConvertSettings settings) -> System.Collections.Generic.IEnumerable<Microsoft.OpenApi.OData.Edm.ODataPath> Microsoft.OpenApi.OData.Edm.IODataPathProvider.GetPaths(Microsoft.OData.Edm.IEdmModel model, Microsoft.OpenApi.OData.OpenApiConvertSettings settings) -> System.Collections.Generic.IEnumerable<Microsoft.OpenApi.OData.Edm.ODataPath>

View file

@ -83,7 +83,7 @@ namespace Microsoft.OpenApi.OData.Edm.Tests
}; };
// Assert // Assert
Assert.Equal("firstName={firstName},lastName={lastName}", segment.GetPathItemName(settings)); Assert.Equal("firstName='{firstName}',lastName='{lastName}'", segment.GetPathItemName(settings));
} }
} }
} }

View file

@ -80,7 +80,7 @@ namespace Microsoft.OpenApi.OData.Edm.Tests
var segment = new ODataOperationImportSegment(_functionImport); var segment = new ODataOperationImportSegment(_functionImport);
// Assert // Assert
Assert.Equal("MyFunction(firstName={firstName},lastName={lastName})", Assert.Equal("MyFunction(firstName='{firstName}',lastName='{lastName}')",
segment.GetPathItemName(new OpenApiConvertSettings())); segment.GetPathItemName(new OpenApiConvertSettings()));
} }
} }

View file

@ -98,9 +98,9 @@ namespace Microsoft.OpenApi.OData.Edm.Tests
[Theory] [Theory]
[InlineData(true, true, "{param}")] [InlineData(true, true, "{param}")]
[InlineData(true, false, "NS.MyFunction(param={param})")] [InlineData(true, false, "NS.MyFunction(param='{param}')")]
[InlineData(false, true, "NS.MyFunction(param={param})")] [InlineData(false, true, "NS.MyFunction(param='{param}')")]
[InlineData(false, false, "NS.MyFunction(param={param})")] [InlineData(false, false, "NS.MyFunction(param='{param}')")]
public void GetPathItemNameReturnsCorrectFunctionLiteralForEscapedFunction(bool isEscapedFunction, bool enableEscapeFunctionCall, string expected) public void GetPathItemNameReturnsCorrectFunctionLiteralForEscapedFunction(bool isEscapedFunction, bool enableEscapeFunctionCall, string expected)
{ {
// Arrange & Act // Arrange & Act
@ -121,9 +121,9 @@ namespace Microsoft.OpenApi.OData.Edm.Tests
[Theory] [Theory]
[InlineData(true, true, "{param}:")] [InlineData(true, true, "{param}:")]
[InlineData(true, false, "NS.MyFunction(param={param})")] [InlineData(true, false, "NS.MyFunction(param='{param}')")]
[InlineData(false, true, "NS.MyFunction(param={param})")] [InlineData(false, true, "NS.MyFunction(param='{param}')")]
[InlineData(false, false, "NS.MyFunction(param={param})")] [InlineData(false, false, "NS.MyFunction(param='{param}')")]
public void GetPathItemNameReturnsCorrectFunctionLiteralForEscapedComposableFunction(bool isEscapedFunction, bool enableEscapeFunctionCall, string expected) public void GetPathItemNameReturnsCorrectFunctionLiteralForEscapedComposableFunction(bool isEscapedFunction, bool enableEscapeFunctionCall, string expected)
{ {
// Arrange & Act // Arrange & Act

View file

@ -249,10 +249,10 @@ namespace Microsoft.OpenApi.OData.Edm.Tests
} }
[Theory] [Theory]
[InlineData(true, true, "/Customers/FirstName={FirstName},LastName={LastName}")] [InlineData(true, true, "/Customers/FirstName='{FirstName}',LastName='{LastName}'")]
[InlineData(true, false, "/Customers/FirstName={FirstName},LastName={LastName}")] [InlineData(true, false, "/Customers/FirstName='{FirstName}',LastName='{LastName}'")]
[InlineData(false, true, "/Customers(FirstName={FirstName},LastName={LastName})")] [InlineData(false, true, "/Customers(FirstName='{FirstName}',LastName='{LastName}')")]
[InlineData(false, false, "/Customers(FirstName={FirstName},LastName={LastName})")] [InlineData(false, false, "/Customers(FirstName='{FirstName}',LastName='{LastName}')")]
public void GetPathItemNameReturnsCorrectStringWithMultipleKeySegment(bool keyAsSegment, bool prefix, string expected) public void GetPathItemNameReturnsCorrectStringWithMultipleKeySegment(bool keyAsSegment, bool prefix, string expected)
{ {
// Arrange // Arrange

View file

@ -75,12 +75,12 @@ namespace Microsoft.OpenApi.OData.Generator.Tests
[InlineData(true, true, true, "/Customers({ID}):/{param}:")] [InlineData(true, true, true, "/Customers({ID}):/{param}:")]
[InlineData(true, true, false, "/Customers({ID}):/{param}")] [InlineData(true, true, false, "/Customers({ID}):/{param}")]
[InlineData(true, false, true, "/Customers({ID})/NS.MyFunction(param={param})")] [InlineData(true, false, true, "/Customers({ID})/NS.MyFunction(param='{param}')")]
[InlineData(true, false, false, "/Customers({ID})/NS.MyFunction(param={param})")] [InlineData(true, false, false, "/Customers({ID})/NS.MyFunction(param='{param}')")]
[InlineData(false, true, true, "/Customers({ID})/NS.MyFunction(param={param})")] [InlineData(false, true, true, "/Customers({ID})/NS.MyFunction(param='{param}')")]
[InlineData(false, true, false, "/Customers({ID})/NS.MyFunction(param={param})")] [InlineData(false, true, false, "/Customers({ID})/NS.MyFunction(param='{param}')")]
[InlineData(false, false, true, "/Customers({ID})/NS.MyFunction(param={param})")] [InlineData(false, false, true, "/Customers({ID})/NS.MyFunction(param='{param}')")]
[InlineData(false, false, false, "/Customers({ID})/NS.MyFunction(param={param})")] [InlineData(false, false, false, "/Customers({ID})/NS.MyFunction(param='{param}')")]
public void CreatePathItemsReturnsForEscapeFunctionModel(bool enableEscaped, bool hasEscapedAnnotation, bool isComposable, string expected) public void CreatePathItemsReturnsForEscapeFunctionModel(bool enableEscaped, bool hasEscapedAnnotation, bool isComposable, string expected)
{ {
// Arrange // Arrange

View file

@ -134,7 +134,7 @@ namespace Microsoft.OpenApi.OData.Operation.Tests
if (enableOperationId) if (enableOperationId)
{ {
Assert.Equal("FunctionImport.MyFunction-3e3f", operation.OperationId); Assert.Equal("FunctionImport.MyFunction-cc1c", operation.OperationId);
} }
else else
{ {

View file

@ -229,7 +229,7 @@ namespace Microsoft.OpenApi.OData.Operation.Tests
if (enableOperationId) if (enableOperationId)
{ {
Assert.Equal("Customers.Customer.MyFunction-28ae", operation.OperationId); Assert.Equal("Customers.Customer.MyFunction-df74", operation.OperationId);
} }
else else
{ {

View file

@ -1,4 +1,4 @@
{ {
"swagger": "2.0", "swagger": "2.0",
"info": { "info": {
"title": "OData Service for namespace Microsoft.OData.Service.Sample.TrippinInMemory.Models", "title": "OData Service for namespace Microsoft.OData.Service.Sample.TrippinInMemory.Models",
@ -1206,7 +1206,7 @@
"x-ms-docs-operation-type": "function" "x-ms-docs-operation-type": "function"
} }
}, },
"/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName={userName})": { "/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName='{userName}')": {
"get": { "get": {
"tags": [ "tags": [
"Me.Functions" "Me.Functions"
@ -1220,7 +1220,7 @@
{ {
"in": "path", "in": "path",
"name": "userName", "name": "userName",
"description": "Usage: userName={userName}", "description": "Usage: userName='{userName}'",
"required": true, "required": true,
"type": "string" "type": "string"
} }
@ -1350,7 +1350,7 @@
"x-ms-docs-operation-type": "action" "x-ms-docs-operation-type": "action"
} }
}, },
"/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName={lastName})": { "/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName='{lastName}')": {
"get": { "get": {
"tags": [ "tags": [
"Me.Functions" "Me.Functions"
@ -1364,7 +1364,7 @@
{ {
"in": "path", "in": "path",
"name": "lastName", "name": "lastName",
"description": "Usage: lastName={lastName}", "description": "Usage: lastName='{lastName}'",
"required": true, "required": true,
"type": "string" "type": "string"
} }
@ -2949,7 +2949,7 @@
"x-ms-docs-operation-type": "function" "x-ms-docs-operation-type": "function"
} }
}, },
"/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName={userName})": { "/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName='{userName}')": {
"get": { "get": {
"tags": [ "tags": [
"NewComePeople.Functions" "NewComePeople.Functions"
@ -2971,7 +2971,7 @@
{ {
"in": "path", "in": "path",
"name": "userName", "name": "userName",
"description": "Usage: userName={userName}", "description": "Usage: userName='{userName}'",
"required": true, "required": true,
"type": "string" "type": "string"
} }
@ -3117,7 +3117,7 @@
"x-ms-docs-operation-type": "action" "x-ms-docs-operation-type": "action"
} }
}, },
"/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName={lastName})": { "/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName='{lastName}')": {
"get": { "get": {
"tags": [ "tags": [
"NewComePeople.Functions" "NewComePeople.Functions"
@ -3139,7 +3139,7 @@
{ {
"in": "path", "in": "path",
"name": "lastName", "name": "lastName",
"description": "Usage: lastName={lastName}", "description": "Usage: lastName='{lastName}'",
"required": true, "required": true,
"type": "string" "type": "string"
} }
@ -4842,7 +4842,7 @@
"x-ms-docs-operation-type": "function" "x-ms-docs-operation-type": "function"
} }
}, },
"/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName={userName})": { "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName='{userName}')": {
"get": { "get": {
"tags": [ "tags": [
"People.Functions" "People.Functions"
@ -4864,7 +4864,7 @@
{ {
"in": "path", "in": "path",
"name": "userName", "name": "userName",
"description": "Usage: userName={userName}", "description": "Usage: userName='{userName}'",
"required": true, "required": true,
"type": "string" "type": "string"
} }
@ -5010,7 +5010,7 @@
"x-ms-docs-operation-type": "action" "x-ms-docs-operation-type": "action"
} }
}, },
"/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName={lastName})": { "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName='{lastName}')": {
"get": { "get": {
"tags": [ "tags": [
"People.Functions" "People.Functions"
@ -5032,7 +5032,7 @@
{ {
"in": "path", "in": "path",
"name": "lastName", "name": "lastName",
"description": "Usage: lastName={lastName}", "description": "Usage: lastName='{lastName}'",
"required": true, "required": true,
"type": "string" "type": "string"
} }

View file

@ -1,4 +1,4 @@
swagger: '2.0' swagger: '2.0'
info: info:
title: OData Service for namespace Microsoft.OData.Service.Sample.TrippinInMemory.Models title: OData Service for namespace Microsoft.OData.Service.Sample.TrippinInMemory.Models
description: This OData service is located at http://services.odata.org/TrippinRESTierService description: This OData service is located at http://services.odata.org/TrippinRESTierService
@ -822,7 +822,7 @@ paths:
default: default:
$ref: '#/responses/error' $ref: '#/responses/error'
x-ms-docs-operation-type: function x-ms-docs-operation-type: function
'/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName={userName})': '/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName=''{userName}'')':
get: get:
tags: tags:
- Me.Functions - Me.Functions
@ -833,7 +833,7 @@ paths:
parameters: parameters:
- in: path - in: path
name: userName name: userName
description: 'Usage: userName={userName}' description: 'Usage: userName=''{userName}'''
required: true required: true
type: string type: string
responses: responses:
@ -919,7 +919,7 @@ paths:
default: default:
$ref: '#/responses/error' $ref: '#/responses/error'
x-ms-docs-operation-type: action x-ms-docs-operation-type: action
'/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName={lastName})': '/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName=''{lastName}'')':
get: get:
tags: tags:
- Me.Functions - Me.Functions
@ -930,7 +930,7 @@ paths:
parameters: parameters:
- in: path - in: path
name: lastName name: lastName
description: 'Usage: lastName={lastName}' description: 'Usage: lastName=''{lastName}'''
required: true required: true
type: string type: string
responses: responses:
@ -2038,7 +2038,7 @@ paths:
default: default:
$ref: '#/responses/error' $ref: '#/responses/error'
x-ms-docs-operation-type: function x-ms-docs-operation-type: function
'/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName={userName})': '/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName=''{userName}'')':
get: get:
tags: tags:
- NewComePeople.Functions - NewComePeople.Functions
@ -2055,7 +2055,7 @@ paths:
x-ms-docs-key-type: Person x-ms-docs-key-type: Person
- in: path - in: path
name: userName name: userName
description: 'Usage: userName={userName}' description: 'Usage: userName=''{userName}'''
required: true required: true
type: string type: string
responses: responses:
@ -2153,7 +2153,7 @@ paths:
default: default:
$ref: '#/responses/error' $ref: '#/responses/error'
x-ms-docs-operation-type: action x-ms-docs-operation-type: action
'/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName={lastName})': '/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName=''{lastName}'')':
get: get:
tags: tags:
- NewComePeople.Functions - NewComePeople.Functions
@ -2170,7 +2170,7 @@ paths:
x-ms-docs-key-type: Person x-ms-docs-key-type: Person
- in: path - in: path
name: lastName name: lastName
description: 'Usage: lastName={lastName}' description: 'Usage: lastName=''{lastName}'''
required: true required: true
type: string type: string
responses: responses:
@ -3364,7 +3364,7 @@ paths:
default: default:
$ref: '#/responses/error' $ref: '#/responses/error'
x-ms-docs-operation-type: function x-ms-docs-operation-type: function
'/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName={userName})': '/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName=''{userName}'')':
get: get:
tags: tags:
- People.Functions - People.Functions
@ -3381,7 +3381,7 @@ paths:
x-ms-docs-key-type: Person x-ms-docs-key-type: Person
- in: path - in: path
name: userName name: userName
description: 'Usage: userName={userName}' description: 'Usage: userName=''{userName}'''
required: true required: true
type: string type: string
responses: responses:
@ -3479,7 +3479,7 @@ paths:
default: default:
$ref: '#/responses/error' $ref: '#/responses/error'
x-ms-docs-operation-type: action x-ms-docs-operation-type: action
'/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName={lastName})': '/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName=''{lastName}'')':
get: get:
tags: tags:
- People.Functions - People.Functions
@ -3496,7 +3496,7 @@ paths:
x-ms-docs-key-type: Person x-ms-docs-key-type: Person
- in: path - in: path
name: lastName name: lastName
description: 'Usage: lastName={lastName}' description: 'Usage: lastName=''{lastName}'''
required: true required: true
type: string type: string
responses: responses:

View file

@ -1,4 +1,4 @@
{ {
"openapi": "3.0.1", "openapi": "3.0.1",
"info": { "info": {
"title": "OData Service for namespace Microsoft.OData.Service.Sample.TrippinInMemory.Models", "title": "OData Service for namespace Microsoft.OData.Service.Sample.TrippinInMemory.Models",
@ -1370,7 +1370,7 @@
"x-ms-docs-operation-type": "function" "x-ms-docs-operation-type": "function"
} }
}, },
"/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName={userName})": { "/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName='{userName}')": {
"get": { "get": {
"tags": [ "tags": [
"Me.Functions" "Me.Functions"
@ -1381,7 +1381,7 @@
{ {
"name": "userName", "name": "userName",
"in": "path", "in": "path",
"description": "Usage: userName={userName}", "description": "Usage: userName='{userName}'",
"required": true, "required": true,
"schema": { "schema": {
"type": "string" "type": "string"
@ -1522,7 +1522,7 @@
"x-ms-docs-operation-type": "action" "x-ms-docs-operation-type": "action"
} }
}, },
"/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName={lastName})": { "/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName='{lastName}')": {
"get": { "get": {
"tags": [ "tags": [
"Me.Functions" "Me.Functions"
@ -1533,7 +1533,7 @@
{ {
"name": "lastName", "name": "lastName",
"in": "path", "in": "path",
"description": "Usage: lastName={lastName}", "description": "Usage: lastName='{lastName}'",
"required": true, "required": true,
"schema": { "schema": {
"type": "string" "type": "string"
@ -3304,7 +3304,7 @@
"x-ms-docs-operation-type": "function" "x-ms-docs-operation-type": "function"
} }
}, },
"/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName={userName})": { "/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName='{userName}')": {
"get": { "get": {
"tags": [ "tags": [
"NewComePeople.Functions" "NewComePeople.Functions"
@ -3325,7 +3325,7 @@
{ {
"name": "userName", "name": "userName",
"in": "path", "in": "path",
"description": "Usage: userName={userName}", "description": "Usage: userName='{userName}'",
"required": true, "required": true,
"schema": { "schema": {
"type": "string" "type": "string"
@ -3490,7 +3490,7 @@
"x-ms-docs-operation-type": "action" "x-ms-docs-operation-type": "action"
} }
}, },
"/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName={lastName})": { "/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName='{lastName}')": {
"get": { "get": {
"tags": [ "tags": [
"NewComePeople.Functions" "NewComePeople.Functions"
@ -3511,7 +3511,7 @@
{ {
"name": "lastName", "name": "lastName",
"in": "path", "in": "path",
"description": "Usage: lastName={lastName}", "description": "Usage: lastName='{lastName}'",
"required": true, "required": true,
"schema": { "schema": {
"type": "string" "type": "string"
@ -5427,7 +5427,7 @@
"x-ms-docs-operation-type": "function" "x-ms-docs-operation-type": "function"
} }
}, },
"/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName={userName})": { "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName='{userName}')": {
"get": { "get": {
"tags": [ "tags": [
"People.Functions" "People.Functions"
@ -5448,7 +5448,7 @@
{ {
"name": "userName", "name": "userName",
"in": "path", "in": "path",
"description": "Usage: userName={userName}", "description": "Usage: userName='{userName}'",
"required": true, "required": true,
"schema": { "schema": {
"type": "string" "type": "string"
@ -5613,7 +5613,7 @@
"x-ms-docs-operation-type": "action" "x-ms-docs-operation-type": "action"
} }
}, },
"/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName={lastName})": { "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName='{lastName}')": {
"get": { "get": {
"tags": [ "tags": [
"People.Functions" "People.Functions"
@ -5634,7 +5634,7 @@
{ {
"name": "lastName", "name": "lastName",
"in": "path", "in": "path",
"description": "Usage: lastName={lastName}", "description": "Usage: lastName='{lastName}'",
"required": true, "required": true,
"schema": { "schema": {
"type": "string" "type": "string"

View file

@ -1,4 +1,4 @@
openapi: 3.0.1 openapi: 3.0.1
info: info:
title: OData Service for namespace Microsoft.OData.Service.Sample.TrippinInMemory.Models title: OData Service for namespace Microsoft.OData.Service.Sample.TrippinInMemory.Models
description: This OData service is located at http://services.odata.org/TrippinRESTierService description: This OData service is located at http://services.odata.org/TrippinRESTierService
@ -914,7 +914,7 @@ paths:
default: default:
$ref: '#/components/responses/error' $ref: '#/components/responses/error'
x-ms-docs-operation-type: function x-ms-docs-operation-type: function
'/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName={userName})': '/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName=''{userName}'')':
get: get:
tags: tags:
- Me.Functions - Me.Functions
@ -923,7 +923,7 @@ paths:
parameters: parameters:
- name: userName - name: userName
in: path in: path
description: 'Usage: userName={userName}' description: 'Usage: userName=''{userName}'''
required: true required: true
schema: schema:
type: string type: string
@ -1012,7 +1012,7 @@ paths:
default: default:
$ref: '#/components/responses/error' $ref: '#/components/responses/error'
x-ms-docs-operation-type: action x-ms-docs-operation-type: action
'/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName={lastName})': '/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName=''{lastName}'')':
get: get:
tags: tags:
- Me.Functions - Me.Functions
@ -1021,7 +1021,7 @@ paths:
parameters: parameters:
- name: lastName - name: lastName
in: path in: path
description: 'Usage: lastName={lastName}' description: 'Usage: lastName=''{lastName}'''
required: true required: true
schema: schema:
type: string type: string
@ -2238,7 +2238,7 @@ paths:
default: default:
$ref: '#/components/responses/error' $ref: '#/components/responses/error'
x-ms-docs-operation-type: function x-ms-docs-operation-type: function
'/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName={userName})': '/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName=''{userName}'')':
get: get:
tags: tags:
- NewComePeople.Functions - NewComePeople.Functions
@ -2254,7 +2254,7 @@ paths:
x-ms-docs-key-type: Person x-ms-docs-key-type: Person
- name: userName - name: userName
in: path in: path
description: 'Usage: userName={userName}' description: 'Usage: userName=''{userName}'''
required: true required: true
schema: schema:
type: string type: string
@ -2359,7 +2359,7 @@ paths:
default: default:
$ref: '#/components/responses/error' $ref: '#/components/responses/error'
x-ms-docs-operation-type: action x-ms-docs-operation-type: action
'/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName={lastName})': '/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName=''{lastName}'')':
get: get:
tags: tags:
- NewComePeople.Functions - NewComePeople.Functions
@ -2375,7 +2375,7 @@ paths:
x-ms-docs-key-type: Person x-ms-docs-key-type: Person
- name: lastName - name: lastName
in: path in: path
description: 'Usage: lastName={lastName}' description: 'Usage: lastName=''{lastName}'''
required: true required: true
schema: schema:
type: string type: string
@ -3691,7 +3691,7 @@ paths:
default: default:
$ref: '#/components/responses/error' $ref: '#/components/responses/error'
x-ms-docs-operation-type: function x-ms-docs-operation-type: function
'/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName={userName})': '/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName=''{userName}'')':
get: get:
tags: tags:
- People.Functions - People.Functions
@ -3707,7 +3707,7 @@ paths:
x-ms-docs-key-type: Person x-ms-docs-key-type: Person
- name: userName - name: userName
in: path in: path
description: 'Usage: userName={userName}' description: 'Usage: userName=''{userName}'''
required: true required: true
schema: schema:
type: string type: string
@ -3812,7 +3812,7 @@ paths:
default: default:
$ref: '#/components/responses/error' $ref: '#/components/responses/error'
x-ms-docs-operation-type: action x-ms-docs-operation-type: action
'/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName={lastName})': '/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName=''{lastName}'')':
get: get:
tags: tags:
- People.Functions - People.Functions
@ -3828,7 +3828,7 @@ paths:
x-ms-docs-key-type: Person x-ms-docs-key-type: Person
- name: lastName - name: lastName
in: path in: path
description: 'Usage: lastName={lastName}' description: 'Usage: lastName=''{lastName}'''
required: true required: true
schema: schema:
type: string type: string