diff --git a/src/Microsoft.OpenApi.OData.Reader/Common/Constants.cs b/src/Microsoft.OpenApi.OData.Reader/Common/Constants.cs
index 4df0d422..b33bec10 100644
--- a/src/Microsoft.OpenApi.OData.Reader/Common/Constants.cs
+++ b/src/Microsoft.OpenApi.OData.Reader/Common/Constants.cs
@@ -15,6 +15,11 @@ internal static class Constants
///
public static string ApplicationJsonMediaType = "application/json";
+ ///
+ /// application/octet-stream
+ ///
+ public static string ApplicationOctetStreamMediaType = "application/octet-stream";
+
///
/// Status code: 200
///
diff --git a/src/Microsoft.OpenApi.OData.Reader/Edm/EdmAnnotationExtensions.cs b/src/Microsoft.OpenApi.OData.Reader/Edm/EdmAnnotationExtensions.cs
index f346e7b0..b5eb1e32 100644
--- a/src/Microsoft.OpenApi.OData.Reader/Edm/EdmAnnotationExtensions.cs
+++ b/src/Microsoft.OpenApi.OData.Reader/Edm/EdmAnnotationExtensions.cs
@@ -196,7 +196,7 @@ public static IEnumerable GetCollection(this IEdmModel model, IEdmVocabu
}
}
- return value.ToList();
+ return value?.ToList();
});
}
diff --git a/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPath.cs b/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPath.cs
index bd5abab9..a052bfe9 100644
--- a/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPath.cs
+++ b/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPath.cs
@@ -258,7 +258,11 @@ public int CompareTo(ODataPath other)
private ODataPathKind CalcPathType()
{
- if (Segments.Any(c => c.Kind == ODataSegmentKind.Ref))
+ if (Segments.Any(c => c.Kind == ODataSegmentKind.StreamProperty || c.Kind == ODataSegmentKind.StreamContent))
+ {
+ return ODataPathKind.MediaEntity;
+ }
+ else if (Segments.Any(c => c.Kind == ODataSegmentKind.Ref))
{
return ODataPathKind.Ref;
}
diff --git a/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathKind.cs b/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathKind.cs
index 2a412150..14498a00 100644
--- a/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathKind.cs
+++ b/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathKind.cs
@@ -36,15 +36,20 @@ public enum ODataPathKind
OperationImport,
///
- /// Represents an navigation propert path, for example: ~/users/{id}/onedrive
+ /// Represents an navigation property path, for example: ~/users/{id}/onedrive
///
NavigationProperty,
///
- /// Represents an navigation propert $ref path, for example: ~/users/{id}/onedrive/$ref
+ /// Represents an navigation property $ref path, for example: ~/users/{id}/onedrive/$ref
///
Ref,
+ ///
+ /// Represents a media entity path, for example: ~/me/photo/$value or ~/reports/deviceConfigurationUserActivity/Content
+ ///
+ MediaEntity,
+
///
/// Represents an un-supported/unknown path.
///
diff --git a/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs b/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs
index 4273bb73..49ff1ef9 100644
--- a/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs
+++ b/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs
@@ -126,6 +126,7 @@ private void AppendPath(ODataPath path)
case ODataPathKind.Entity:
case ODataPathKind.EntitySet:
case ODataPathKind.Singleton:
+ case ODataPathKind.MediaEntity:
ODataNavigationSourceSegment navigationSourceSegment = (ODataNavigationSourceSegment)path.FirstSegment;
if (!_allNavigationSourcePaths.TryGetValue(navigationSourceSegment.EntityType, out IList nsList))
{
@@ -182,6 +183,9 @@ private void RetrieveNavigationSourcePaths(IEdmNavigationSource navigationSource
AppendPath(path.Clone());
}
+ // media entity
+ RetrieveMediaEntityStreamPaths(entityType, path);
+
// navigation property
foreach (IEdmNavigationProperty np in entityType.DeclaredNavigationProperties())
{
@@ -200,6 +204,43 @@ private void RetrieveNavigationSourcePaths(IEdmNavigationSource navigationSource
Debug.Assert(path.Any() == false);
}
+ ///
+ /// Retrieves the paths for a media entity stream.
+ ///
+ /// The entity type.
+ /// The current OData path.
+ private void RetrieveMediaEntityStreamPaths(IEdmEntityType entityType, ODataPath currentPath)
+ {
+ Debug.Assert(entityType != null);
+ Debug.Assert(currentPath != null);
+
+ bool createValuePath = true;
+ foreach (IEdmStructuralProperty sp in entityType.DeclaredStructuralProperties())
+ {
+ if (sp.Type.AsPrimitive().IsStream())
+ {
+ currentPath.Push(new ODataStreamPropertySegment(sp.Name));
+ AppendPath(currentPath.Clone());
+ currentPath.Pop();
+ }
+
+ if (sp.Name.Equals("content", System.StringComparison.OrdinalIgnoreCase))
+ {
+ createValuePath = false;
+ }
+ }
+
+ /* Create a /$value path only if entity has stream and
+ * does not contain a structural property named Content
+ */
+ if (createValuePath && entityType.HasStream)
+ {
+ currentPath.Push(new ODataStreamContentSegment());
+ AppendPath(currentPath.Clone());
+ currentPath.Pop();
+ }
+ }
+
///
/// Retrieve the path for .
///
@@ -226,40 +267,45 @@ private void RetrieveNavigationPropertyPaths(IEdmNavigationProperty navigationPr
newPath.Push(ODataRefSegment.Instance); // $ref
AppendPath(newPath);
}
-
- // append a navigation property key.
- IEdmEntityType navEntityType = navigationProperty.ToEntityType();
- if (navigationProperty.TargetMultiplicity() == EdmMultiplicity.Many)
+ else
{
- currentPath.Push(new ODataKeySegment(navEntityType));
- AppendPath(currentPath.Clone());
+ IEdmEntityType navEntityType = navigationProperty.ToEntityType();
- if (!navigationProperty.ContainsTarget)
+ // append a navigation property key.
+ if (navigationProperty.TargetMultiplicity() == EdmMultiplicity.Many)
{
- // TODO: Shall we add "$ref" after {key}, and only support delete?
- // ODataPath newPath = currentPath.Clone();
- // newPath.Push(ODataRefSegment.Instance); // $ref
- // AppendPath(newPath);
+ currentPath.Push(new ODataKeySegment(navEntityType));
+ AppendPath(currentPath.Clone());
+
+ if (!navigationProperty.ContainsTarget)
+ {
+ // TODO: Shall we add "$ref" after {key}, and only support delete?
+ // ODataPath newPath = currentPath.Clone();
+ // newPath.Push(ODataRefSegment.Instance); // $ref
+ // AppendPath(newPath);
+ }
}
- }
- if (shouldExpand)
- {
- // expand to sub navigation properties
- foreach (IEdmNavigationProperty subNavProperty in navEntityType.DeclaredNavigationProperties())
+ if (shouldExpand)
{
- if (CanFilter(subNavProperty))
+ // expand to sub navigation properties
+ foreach (IEdmNavigationProperty subNavProperty in navEntityType.DeclaredNavigationProperties())
{
- RetrieveNavigationPropertyPaths(subNavProperty, currentPath);
+ if (CanFilter(subNavProperty))
+ {
+ RetrieveNavigationPropertyPaths(subNavProperty, currentPath);
+ }
}
}
- }
- if (navigationProperty.TargetMultiplicity() == EdmMultiplicity.Many)
- {
- currentPath.Pop();
- }
+ // Get possible navigation property stream paths
+ RetrieveMediaEntityStreamPaths(navEntityType, currentPath);
+ if (navigationProperty.TargetMultiplicity() == EdmMultiplicity.Many)
+ {
+ currentPath.Pop();
+ }
+ }
currentPath.Pop();
}
@@ -369,7 +415,8 @@ private bool AppendBoundOperationOnNavigationSourcePath(IEdmOperation edmOperati
foreach (var subPath in value)
{
if ((isCollection && subPath.Kind == ODataPathKind.EntitySet) ||
- (!isCollection && subPath.Kind != ODataPathKind.EntitySet))
+ (!isCollection && subPath.Kind != ODataPathKind.EntitySet &&
+ subPath.Kind != ODataPathKind.MediaEntity))
{
ODataPath newPath = subPath.Clone();
newPath.Push(new ODataOperationSegment(edmOperation, isEscapedFunction));
diff --git a/src/Microsoft.OpenApi.OData.Reader/Edm/ODataSegment.cs b/src/Microsoft.OpenApi.OData.Reader/Edm/ODataSegment.cs
index ad43a9f0..b6fb0e8b 100644
--- a/src/Microsoft.OpenApi.OData.Reader/Edm/ODataSegment.cs
+++ b/src/Microsoft.OpenApi.OData.Reader/Edm/ODataSegment.cs
@@ -47,7 +47,17 @@ public enum ODataSegmentKind
///
/// $ref
///
- Ref
+ Ref,
+
+ ///
+ /// Stream content -> $value
+ ///
+ StreamContent,
+
+ ///
+ /// Stream property
+ ///
+ StreamProperty
}
///
diff --git a/src/Microsoft.OpenApi.OData.Reader/Edm/ODataStreamContentSegment.cs b/src/Microsoft.OpenApi.OData.Reader/Edm/ODataStreamContentSegment.cs
new file mode 100644
index 00000000..aba66263
--- /dev/null
+++ b/src/Microsoft.OpenApi.OData.Reader/Edm/ODataStreamContentSegment.cs
@@ -0,0 +1,24 @@
+// ------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
+// ------------------------------------------------------------
+
+using System.Collections.Generic;
+
+namespace Microsoft.OpenApi.OData.Edm
+{
+ ///
+ /// Stream segment.
+ ///
+ public class ODataStreamContentSegment : ODataSegment
+ {
+ ///
+ public override ODataSegmentKind Kind => ODataSegmentKind.StreamContent;
+
+ ///
+ public override string Identifier => "$value";
+
+ ///
+ public override string GetPathItemName(OpenApiConvertSettings settings, HashSet parameters) => "$value";
+ }
+}
\ No newline at end of file
diff --git a/src/Microsoft.OpenApi.OData.Reader/Edm/ODataStreamPropertySegment.cs b/src/Microsoft.OpenApi.OData.Reader/Edm/ODataStreamPropertySegment.cs
new file mode 100644
index 00000000..efca6864
--- /dev/null
+++ b/src/Microsoft.OpenApi.OData.Reader/Edm/ODataStreamPropertySegment.cs
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
+// ------------------------------------------------------------
+
+using System.Collections.Generic;
+using Microsoft.OpenApi.OData.Common;
+
+namespace Microsoft.OpenApi.OData.Edm
+{
+ ///
+ /// Property Stream segment.
+ ///
+ public class ODataStreamPropertySegment : ODataSegment
+ {
+ private readonly string _streamPropertyName;
+ ///
+ /// Initializes a new instance of class.
+ ///
+ /// The name of the stream property.
+ public ODataStreamPropertySegment(string streamPropertyName)
+ {
+ _streamPropertyName = streamPropertyName ?? throw Error.ArgumentNull(nameof(streamPropertyName));
+ }
+
+ ///
+ public override ODataSegmentKind Kind => ODataSegmentKind.StreamProperty;
+
+ ///
+ public override string Identifier { get => _streamPropertyName; }
+
+ ///
+ public override string GetPathItemName(OpenApiConvertSettings settings, HashSet parameters) => _streamPropertyName;
+ }
+}
diff --git a/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiParameterGenerator.cs b/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiParameterGenerator.cs
index 8c19d76d..533098a2 100644
--- a/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiParameterGenerator.cs
+++ b/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiParameterGenerator.cs
@@ -30,7 +30,7 @@ internal static class OpenApiParameterGenerator
public static IDictionary CreateParameters(this ODataContext context)
{
Utils.CheckArgumentNull(context, nameof(context));
-
+
// It allows defining query options and headers that can be reused across operations of the service.
// The value of parameters is a map of Parameter Objects.
return new Dictionary
@@ -134,7 +134,10 @@ public static IList CreateKeyParameters(this ODataContext cont
if (keys.Count() == 1)
{
string keyName = keys.First().Name;
- if (context.Settings.PrefixEntityTypeNameBeforeKey)
+
+ // If dictionary parameterNameMapping is defined, there's no need of setting the
+ // keyName, we will retrieve this from the dictionary key.
+ if (context.Settings.PrefixEntityTypeNameBeforeKey && parameterNameMapping == null)
{
keyName = entityType.Name + "-" + keys.First().Name;
}
diff --git a/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiPathItemGenerator.cs b/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiPathItemGenerator.cs
index 8c834ec4..253a4ccc 100644
--- a/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiPathItemGenerator.cs
+++ b/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiPathItemGenerator.cs
@@ -4,6 +4,7 @@
// ------------------------------------------------------------
using System.Collections.Generic;
+using Microsoft.OData.Edm;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.OData.Common;
using Microsoft.OpenApi.OData.Edm;
@@ -44,7 +45,40 @@ public static IDictionary CreatePathItems(this ODataCon
pathItems.Add(path.GetPathItemName(settings), handler.CreatePathItem(context, path));
}
+ if (settings.ShowRootPath)
+ {
+ OpenApiPathItem rootPath = new OpenApiPathItem()
+ {
+ Operations = new Dictionary {
+ {
+ OperationType.Get, new OpenApiOperation {
+ OperationId = "graphService.GetGraphService",
+ Responses = new OpenApiResponses()
+ {
+ { "200",new OpenApiResponse() {
+ Description = "OK",
+ Links = CreateRootLinks(context.EntityContainer)
+ }
+ }
+ }
+ }
+ }
+ }
+ };
+ pathItems.Add("/", rootPath);
+ }
+
return pathItems;
}
+
+ private static IDictionary CreateRootLinks(IEdmEntityContainer entityContainer)
+ {
+ var links = new Dictionary();
+ foreach (var element in entityContainer.Elements)
+ {
+ links.Add(element.Name, new OpenApiLink());
+ }
+ return links;
+ }
}
}
diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj
index 0238ea28..a62e1489 100644
--- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj
+++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj
@@ -20,7 +20,7 @@
-
+
diff --git a/src/Microsoft.OpenApi.OData.Reader/OpenApiConvertSettings.cs b/src/Microsoft.OpenApi.OData.Reader/OpenApiConvertSettings.cs
index b7c2c4b0..8cfd5112 100644
--- a/src/Microsoft.OpenApi.OData.Reader/OpenApiConvertSettings.cs
+++ b/src/Microsoft.OpenApi.OData.Reader/OpenApiConvertSettings.cs
@@ -130,6 +130,11 @@ public class OpenApiConvertSettings
///
public bool ShowSchemaExamples { get; set; } = false;
+ ///
+ /// Gets/sets a value indicating whether or not to show the root path of the described API.
+ ///
+ public bool ShowRootPath { get; set; } = false;
+
internal OpenApiConvertSettings Clone()
{
var newSettings = new OpenApiConvertSettings
@@ -156,7 +161,8 @@ internal OpenApiConvertSettings Clone()
EnableDerivedTypesReferencesForRequestBody = this.EnableDerivedTypesReferencesForRequestBody,
PathPrefix = this.PathPrefix,
ShowLinks = this.ShowLinks,
- ShowSchemaExamples = this.ShowSchemaExamples
+ ShowSchemaExamples = this.ShowSchemaExamples,
+ ShowRootPath = this.ShowRootPath
};
return newSettings;
diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/EntitySetPostOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/EntitySetPostOperationHandler.cs
index 5233ff25..381fd56b 100644
--- a/src/Microsoft.OpenApi.OData.Reader/Operation/EntitySetPostOperationHandler.cs
+++ b/src/Microsoft.OpenApi.OData.Reader/Operation/EntitySetPostOperationHandler.cs
@@ -43,40 +43,13 @@ protected override void SetBasicInfo(OpenApiOperation operation)
///
protected override void SetRequestBody(OpenApiOperation operation)
{
- OpenApiSchema schema = null;
-
- if (Context.Settings.EnableDerivedTypesReferencesForRequestBody)
- {
- schema = EdmModelHelper.GetDerivedTypesReferenceSchema(EntitySet.EntityType(), Context.Model);
- }
-
- if (schema == null)
- {
- schema = new OpenApiSchema
- {
- Reference = new OpenApiReference
- {
- Type = ReferenceType.Schema,
- Id = EntitySet.EntityType().FullName()
- }
- };
- }
-
// The requestBody field contains a Request Body Object for the request body
// that references the schema of the entity set’s entity type in the global schemas.
operation.RequestBody = new OpenApiRequestBody
{
Required = true,
Description = "New entity",
- Content = new Dictionary
- {
- {
- Constants.ApplicationJsonMediaType, new OpenApiMediaType
- {
- Schema = schema
- }
- }
- }
+ Content = GetContentDescription()
};
base.SetRequestBody(operation);
@@ -85,25 +58,6 @@ protected override void SetRequestBody(OpenApiOperation operation)
///
protected override void SetResponses(OpenApiOperation operation)
{
- OpenApiSchema schema = null;
-
- if (Context.Settings.EnableDerivedTypesReferencesForResponses)
- {
- schema = EdmModelHelper.GetDerivedTypesReferenceSchema(EntitySet.EntityType(), Context.Model);
- }
-
- if (schema == null)
- {
- schema = new OpenApiSchema
- {
- Reference = new OpenApiReference
- {
- Type = ReferenceType.Schema,
- Id = EntitySet.EntityType().FullName()
- }
- };
- }
-
operation.Responses = new OpenApiResponses
{
{
@@ -111,16 +65,7 @@ protected override void SetResponses(OpenApiOperation operation)
new OpenApiResponse
{
Description = "Created entity",
- Content = new Dictionary
- {
- {
- Constants.ApplicationJsonMediaType,
- new OpenApiMediaType
- {
- Schema = schema
- }
- }
- }
+ Content = GetContentDescription()
}
}
};
@@ -159,5 +104,76 @@ protected override void AppendCustomParameters(OpenApiOperation operation)
AppendCustomParameters(operation, insert.CustomHeaders, ParameterLocation.Header);
}
}
+
+ ///
+ /// Get the entity content description.
+ ///
+ /// The entity content description.
+ private IDictionary GetContentDescription()
+ {
+ OpenApiSchema schema = GetEntitySchema();
+ var content = new Dictionary();
+
+ if (EntitySet.EntityType().HasStream)
+ {
+ IEnumerable mediaTypes = Context.Model.GetCollection(EntitySet.EntityType(),
+ CapabilitiesConstants.AcceptableMediaTypes);
+
+ if (mediaTypes != null)
+ {
+ foreach (string item in mediaTypes)
+ {
+ content.Add(item, null);
+ }
+ }
+ else
+ {
+ // Default content type
+ content.Add(Constants.ApplicationOctetStreamMediaType, new OpenApiMediaType
+ {
+ Schema = new OpenApiSchema
+ {
+ Type = "string",
+ Format = "binary"
+ }
+ });
+ }
+ }
+
+ content.Add(Constants.ApplicationJsonMediaType, new OpenApiMediaType
+ {
+ Schema = schema
+ });
+
+ return content;
+ }
+
+ ///
+ /// Get the entity schema.
+ ///
+ /// The entity schema.
+ private OpenApiSchema GetEntitySchema()
+ {
+ OpenApiSchema schema = null;
+
+ if (Context.Settings.EnableDerivedTypesReferencesForRequestBody)
+ {
+ schema = EdmModelHelper.GetDerivedTypesReferenceSchema(EntitySet.EntityType(), Context.Model);
+ }
+
+ if (schema == null)
+ {
+ schema = new OpenApiSchema
+ {
+ Reference = new OpenApiReference
+ {
+ Type = ReferenceType.Schema,
+ Id = EntitySet.EntityType().FullName()
+ }
+ };
+ }
+
+ return schema;
+ }
}
}
diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/MediaEntityGetOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/MediaEntityGetOperationHandler.cs
new file mode 100644
index 00000000..083d78a3
--- /dev/null
+++ b/src/Microsoft.OpenApi.OData.Reader/Operation/MediaEntityGetOperationHandler.cs
@@ -0,0 +1,91 @@
+// ------------------------------------------------------------
+// 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;
+using Microsoft.OpenApi.Models;
+using Microsoft.OpenApi.OData.Common;
+using Microsoft.OpenApi.OData.Edm;
+using Microsoft.OpenApi.OData.Generator;
+using Microsoft.OpenApi.OData.Vocabulary.Capabilities;
+using System.Linq;
+
+namespace Microsoft.OpenApi.OData.Operation
+{
+ ///
+ /// Retrieve a media content for an Entity
+ ///
+ internal class MediaEntityGetOperationHandler : MediaEntityOperationalHandler
+ {
+ ///
+ public override OperationType OperationType => OperationType.Get;
+
+ ///
+ protected override void SetBasicInfo(OpenApiOperation operation)
+ {
+ // Summary
+ if (IsNavigationPropertyPath)
+ {
+ operation.Summary = $"Get media content for the navigation property {NavigationProperty.Name} from {NavigationSource.Name}";
+ }
+ else
+ {
+ string typeName = EntitySet.EntityType().Name;
+ operation.Summary = $"Get media content for {typeName} from {EntitySet.Name}";
+ }
+
+ // OperationId
+ if (Context.Settings.EnableOperationId)
+ {
+ string identifier = Path.LastSegment.Kind == ODataSegmentKind.StreamContent ? "Content" : Path.LastSegment.Identifier;
+ operation.OperationId = GetOperationId("Get", identifier);
+ }
+
+ base.SetBasicInfo(operation);
+ }
+
+ ///
+ protected override void SetResponses(OpenApiOperation operation)
+ {
+ operation.Responses = new OpenApiResponses
+ {
+ {
+ Constants.StatusCode200,
+ new OpenApiResponse
+ {
+ Description = "Retrieved media content",
+ Content = GetContentDescription()
+ }
+ }
+ };
+ operation.Responses.Add(Constants.StatusCodeDefault, Constants.StatusCodeDefault.GetResponse());
+
+ base.SetResponses(operation);
+ }
+ ///
+ protected override void SetSecurity(OpenApiOperation operation)
+ {
+ ReadRestrictionsType read = EntitySet != null
+ ? Context.Model.GetRecord(EntitySet, CapabilitiesConstants.ReadRestrictions)
+ : Context.Model.GetRecord(Singleton, CapabilitiesConstants.ReadRestrictions);
+ if (read == null)
+ {
+ return;
+ }
+
+ ReadRestrictionsBase readBase = read;
+ if (read.ReadByKeyRestrictions != null)
+ {
+ readBase = read.ReadByKeyRestrictions;
+ }
+
+ if (readBase == null && readBase.Permissions == null)
+ {
+ return;
+ }
+
+ operation.Security = Context.CreateSecurityRequirements(readBase.Permissions).ToList();
+ }
+ }
+}
diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/MediaEntityOperationalHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/MediaEntityOperationalHandler.cs
new file mode 100644
index 00000000..8fa28d09
--- /dev/null
+++ b/src/Microsoft.OpenApi.OData.Reader/Operation/MediaEntityOperationalHandler.cs
@@ -0,0 +1,212 @@
+// ------------------------------------------------------------
+// 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;
+using Microsoft.OData.Edm.Vocabularies;
+using Microsoft.OpenApi.Any;
+using Microsoft.OpenApi.Models;
+using Microsoft.OpenApi.OData.Common;
+using Microsoft.OpenApi.OData.Edm;
+using Microsoft.OpenApi.OData.Vocabulary.Capabilities;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Microsoft.OpenApi.OData.Operation
+{
+ ///
+ /// Base class for operation of media entity.
+ ///
+ internal abstract class MediaEntityOperationalHandler : NavigationPropertyOperationHandler
+ {
+ ///
+ /// Gets/sets the .
+ ///
+ protected IEdmEntitySet EntitySet { get; private set; }
+
+ ///
+ /// Gets the .
+ ///
+ protected IEdmSingleton Singleton { get; private set; }
+
+ ///
+ /// Gets/Sets flag indicating whether path is navigation property path
+ ///
+ protected bool IsNavigationPropertyPath { get; private set; }
+
+ ///
+ protected override void Initialize(ODataContext context, ODataPath path)
+ {
+ // The first segment will either be an EntitySet navigation source or a Singleton navigation source
+ ODataNavigationSourceSegment navigationSourceSegment = path.FirstSegment as ODataNavigationSourceSegment;
+ EntitySet = navigationSourceSegment.NavigationSource as IEdmEntitySet;
+
+ if (EntitySet == null)
+ {
+ Singleton = navigationSourceSegment.NavigationSource as IEdmSingleton;
+ }
+
+ // Check whether path is a navigation property path
+ IsNavigationPropertyPath = Path.Segments.Contains(
+ Path.Segments.Where(segment => segment is ODataNavigationPropertySegment).FirstOrDefault());
+
+ if (IsNavigationPropertyPath)
+ {
+ // Initialize navigation property paths from base
+ base.Initialize(context, path);
+ }
+ }
+
+ ///
+ protected override void SetTags(OpenApiOperation operation)
+ {
+ if (IsNavigationPropertyPath)
+ {
+ base.SetTags(operation);
+ }
+ else
+ {
+ string tagIdentifier = EntitySet.Name + "." + EntitySet.EntityType().Name;
+
+ OpenApiTag tag = new OpenApiTag
+ {
+ Name = tagIdentifier
+ };
+
+ // Use an extension for TOC (Table of Content)
+ tag.Extensions.Add(Constants.xMsTocType, new OpenApiString("page"));
+
+ operation.Tags.Add(tag);
+
+ Context.AppendTag(tag);
+ }
+ }
+
+ ///
+ protected override void SetExtensions(OpenApiOperation operation)
+ {
+ base.SetExtensions(operation);
+ }
+
+ ///
+ /// Retrieves the operation Id for a media entity stream path.
+ ///
+ /// The http method identifier name.
+ /// The stream segment identifier name.
+ ///
+ protected string GetOperationId(string prefix, string identifier)
+ {
+ Utils.CheckArgumentNullOrEmpty(prefix, nameof(prefix));
+ Utils.CheckArgumentNullOrEmpty(identifier, nameof(identifier));
+
+ IList items = new List
+ {
+ EntitySet?.Name ?? Singleton.Name
+ };
+
+ ODataSegment lastSegment = Path.Segments.Last(c => c is ODataStreamContentSegment || c is ODataStreamPropertySegment);
+ foreach (ODataSegment segment in Path.Segments.Skip(1))
+ {
+ if (segment == lastSegment)
+ {
+ if (!IsNavigationPropertyPath)
+ {
+ string typeName = EntitySet?.EntityType().Name ?? Singleton.EntityType().Name;
+ items.Add(typeName);
+ items.Add(prefix + Utils.UpperFirstChar(identifier));
+ }
+ else
+ {
+ // Remove the last navigation property segment for navigation property paths,
+ // as this will be included within the prefixed name of the operation id
+ items.Remove(NavigationProperty.Name);
+ items.Add(prefix + Utils.UpperFirstChar(NavigationProperty.Name) + Utils.UpperFirstChar(identifier));
+ }
+ break;
+ }
+ else
+ {
+ if (segment is ODataNavigationPropertySegment npSegment)
+ {
+ items.Add(npSegment.NavigationProperty.Name);
+ }
+ }
+ }
+
+ return string.Join(".", items);
+ }
+
+ ///
+ /// Gets a media entity content description.
+ ///
+ /// The entity content description.
+ protected IDictionary GetContentDescription()
+ {
+ var content = new Dictionary();
+
+ OpenApiSchema schema = new OpenApiSchema
+ {
+ Type = "string",
+ Format = "binary"
+ };
+
+ IEdmVocabularyAnnotatable annotatableElement = null;
+ IEdmEntityType entityType = EntitySet != null ? EntitySet.EntityType() : Singleton.EntityType();
+ ODataSegment lastSegmentStreamProp = Path.Segments.LastOrDefault(c => c is ODataStreamPropertySegment);
+
+ if (lastSegmentStreamProp != null)
+ {
+ // Get the annotatable stream property
+ // The stream property can either be a structural type or navigation type property
+ IEdmProperty property = GetStructuralProperty(entityType, lastSegmentStreamProp.Identifier);
+ if (property == null)
+ {
+ property = GetNavigationProperty(entityType, lastSegmentStreamProp.Identifier);
+ }
+
+ annotatableElement = property;
+ }
+ else
+ {
+ annotatableElement = entityType;
+ }
+
+ // Fetch the respective AcceptableMediaTypes
+ IEnumerable mediaTypes = null;
+ if (annotatableElement != null)
+ {
+ mediaTypes = Context.Model.GetCollection(annotatableElement,
+ CapabilitiesConstants.AcceptableMediaTypes);
+ }
+
+ if (mediaTypes != null)
+ {
+ foreach (string item in mediaTypes)
+ {
+ content.Add(item, null);
+ }
+ }
+ else
+ {
+ // Default content type
+ content.Add(Constants.ApplicationOctetStreamMediaType, new OpenApiMediaType
+ {
+ Schema = schema
+ });
+ };
+
+ return content;
+ }
+
+ private IEdmStructuralProperty GetStructuralProperty(IEdmEntityType entityType, string identifier)
+ {
+ return entityType.DeclaredStructuralProperties().FirstOrDefault(x => x.Name.Equals(identifier));
+ }
+
+ private IEdmNavigationProperty GetNavigationProperty(IEdmEntityType entityType, string identifier)
+ {
+ return entityType.DeclaredNavigationProperties().FirstOrDefault(x => x.Name.Equals(identifier));
+ }
+ }
+}
diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/MediaEntityPutOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/MediaEntityPutOperationHandler.cs
new file mode 100644
index 00000000..8aff1d0a
--- /dev/null
+++ b/src/Microsoft.OpenApi.OData.Reader/Operation/MediaEntityPutOperationHandler.cs
@@ -0,0 +1,87 @@
+// ------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
+// ------------------------------------------------------------
+
+using System.Linq;
+using Microsoft.OData.Edm;
+using Microsoft.OpenApi.Models;
+using Microsoft.OpenApi.OData.Common;
+using Microsoft.OpenApi.OData.Edm;
+using Microsoft.OpenApi.OData.Generator;
+using Microsoft.OpenApi.OData.Vocabulary.Capabilities;
+
+namespace Microsoft.OpenApi.OData.Operation
+{
+ ///
+ /// Update a media content for an Entity
+ ///
+ internal class MediaEntityPutOperationHandler : MediaEntityOperationalHandler
+ {
+ ///
+ public override OperationType OperationType => OperationType.Put;
+
+ ///
+ protected override void SetBasicInfo(OpenApiOperation operation)
+ {
+ // Summary
+ if (IsNavigationPropertyPath)
+ {
+ operation.Summary = $"Update media content for the navigation property {NavigationProperty.Name} in {NavigationSource.Name}";
+ }
+ else
+ {
+ string typeName = EntitySet.EntityType().Name;
+ operation.Summary = $"Update media content for {typeName} in {EntitySet.Name}";
+ }
+
+ // OperationId
+ if (Context.Settings.EnableOperationId)
+ {
+ string identifier = Path.LastSegment.Kind == ODataSegmentKind.StreamContent ? "Content" : Path.LastSegment.Identifier;
+ operation.OperationId = GetOperationId("Update", identifier);
+ }
+
+ base.SetBasicInfo(operation);
+ }
+
+ ///
+ protected override void SetRequestBody(OpenApiOperation operation)
+ {
+ operation.RequestBody = new OpenApiRequestBody
+ {
+ Required = true,
+ Description = "New media content.",
+ Content = GetContentDescription()
+ };
+
+ base.SetRequestBody(operation);
+ }
+
+ ///
+ protected override void SetResponses(OpenApiOperation operation)
+ {
+ operation.Responses = new OpenApiResponses
+ {
+ { Constants.StatusCode204, Constants.StatusCode204.GetResponse() },
+ { Constants.StatusCodeDefault, Constants.StatusCodeDefault.GetResponse() }
+ };
+
+ base.SetResponses(operation);
+ }
+
+ ///
+ protected override void SetSecurity(OpenApiOperation operation)
+ {
+ UpdateRestrictionsType update = EntitySet != null
+ ? Context.Model.GetRecord(EntitySet, CapabilitiesConstants.UpdateRestrictions)
+ : Context.Model.GetRecord(Singleton, CapabilitiesConstants.UpdateRestrictions);
+ if (update == null || update.Permissions == null)
+ {
+ return;
+ }
+
+ operation.Security = Context.CreateSecurityRequirements(update.Permissions).ToList();
+ }
+ }
+}
diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyOperationHandler.cs
index dab1643f..c183fa26 100644
--- a/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyOperationHandler.cs
+++ b/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyOperationHandler.cs
@@ -62,7 +62,8 @@ protected override void Initialize(ODataContext context, ODataPath path)
NavigationProperty = path.OfType().Last().NavigationProperty;
NavigationPropertyPath = string.Join("/",
- Path.Segments.Where(s => !(s is ODataKeySegment || s is ODataNavigationSourceSegment)).Select(e => e.Identifier));
+ Path.Segments.Where(s => !(s is ODataKeySegment || s is ODataNavigationSourceSegment
+ || s is ODataStreamContentSegment || s is ODataStreamPropertySegment)).Select(e => e.Identifier));
IEdmEntitySet entitySet = NavigationSource as IEdmEntitySet;
IEdmSingleton singleton = NavigationSource as IEdmSingleton;
@@ -115,7 +116,7 @@ protected override void SetTags(OpenApiOperation operation)
}
}
}
-
+
string name = string.Join(".", items);
OpenApiTag tag = new OpenApiTag
{
diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/OperationHandlerProvider.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/OperationHandlerProvider.cs
index 8679e01d..3d3abce2 100644
--- a/src/Microsoft.OpenApi.OData.Reader/Operation/OperationHandlerProvider.cs
+++ b/src/Microsoft.OpenApi.OData.Reader/Operation/OperationHandlerProvider.cs
@@ -68,14 +68,21 @@ public OperationHandlerProvider()
{OperationType.Delete, new NavigationPropertyDeleteOperationHandler() }
};
- // navigatoin property ref (Get/Post/Patch/Delete)
+ // navigation property ref (Get/Post/Put/Delete)
_handlers[ODataPathKind.Ref] = new Dictionary
{
{OperationType.Get, new RefGetOperationHandler() },
- {OperationType.Patch, new RefPatchOperationHandler() },
+ {OperationType.Put, new RefPutOperationHandler() },
{OperationType.Post, new RefPostOperationHandler() },
{OperationType.Delete, new RefDeleteOperationHandler() }
};
+
+ // media entity operation (Get|Put)
+ _handlers[ODataPathKind.MediaEntity] = new Dictionary
+ {
+ {OperationType.Get, new MediaEntityGetOperationHandler() },
+ {OperationType.Put, new MediaEntityPutOperationHandler() }
+ };
}
///
diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs
index 33226765..ede32705 100644
--- a/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs
+++ b/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs
@@ -40,7 +40,8 @@ protected override void SetRequestBody(OpenApiOperation operation)
{
OpenApiSchema schema = new OpenApiSchema
{
- Type = "String"
+ Type = "object",
+ AdditionalProperties = new OpenApiSchema { Type = "object" }
};
operation.RequestBody = new OpenApiRequestBody
@@ -66,7 +67,7 @@ protected override void SetResponses(OpenApiOperation operation)
{
OpenApiSchema schema = new OpenApiSchema
{
- Type = "String" // What to return?
+ Type = "object"
};
operation.Responses = new OpenApiResponses
diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/RefPatchOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/RefPutOperationHandler.cs
similarity index 94%
rename from src/Microsoft.OpenApi.OData.Reader/Operation/RefPatchOperationHandler.cs
rename to src/Microsoft.OpenApi.OData.Reader/Operation/RefPutOperationHandler.cs
index 74aa410e..0a97ca6f 100644
--- a/src/Microsoft.OpenApi.OData.Reader/Operation/RefPatchOperationHandler.cs
+++ b/src/Microsoft.OpenApi.OData.Reader/Operation/RefPutOperationHandler.cs
@@ -14,7 +14,7 @@ namespace Microsoft.OpenApi.OData.Operation
///
/// Update a navigation property ref for a navigation source.
///
- internal class RefPatchOperationHandler : NavigationPropertyOperationHandler
+ internal class RefPutOperationHandler : NavigationPropertyOperationHandler
{
///
public override OperationType OperationType => OperationType.Patch;
@@ -40,7 +40,8 @@ protected override void SetRequestBody(OpenApiOperation operation)
{
OpenApiSchema schema = new OpenApiSchema
{
- Type = "String"
+ Type = "object",
+ AdditionalProperties = new OpenApiSchema { Type = "object" }
};
operation.RequestBody = new OpenApiRequestBody
diff --git a/src/Microsoft.OpenApi.OData.Reader/PathItem/MediaEntityPathItemHandler.cs b/src/Microsoft.OpenApi.OData.Reader/PathItem/MediaEntityPathItemHandler.cs
new file mode 100644
index 00000000..d7ec6c34
--- /dev/null
+++ b/src/Microsoft.OpenApi.OData.Reader/PathItem/MediaEntityPathItemHandler.cs
@@ -0,0 +1,70 @@
+// ------------------------------------------------------------
+// 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;
+using Microsoft.OpenApi.Models;
+using Microsoft.OpenApi.OData.Edm;
+using Microsoft.OpenApi.OData.Vocabulary.Capabilities;
+
+namespace Microsoft.OpenApi.OData.PathItem
+{
+ ///
+ /// Create a for a media entity.
+ ///
+ internal class MediaEntityPathItemHandler : PathItemHandler
+ {
+ ///
+ protected override ODataPathKind HandleKind => ODataPathKind.MediaEntity;
+
+ ///
+ /// Gets the entity set.
+ ///
+ protected IEdmEntitySet EntitySet { get; private set; }
+
+ ///
+ /// Gets the singleton.
+ ///
+ protected IEdmSingleton Singleton { get; private set; }
+
+ ///
+ protected override void SetOperations(OpenApiPathItem item)
+ {
+ ReadRestrictionsType read = EntitySet != null
+ ? Context.Model.GetRecord(EntitySet)
+ : Context.Model.GetRecord(Singleton);
+
+ if (read == null ||
+ (read.ReadByKeyRestrictions == null && read.IsReadable) ||
+ (read.ReadByKeyRestrictions != null && read.ReadByKeyRestrictions.IsReadable))
+ {
+ AddOperation(item, OperationType.Get);
+ }
+
+ UpdateRestrictionsType update = EntitySet != null
+ ? Context.Model.GetRecord(EntitySet)
+ : Context.Model.GetRecord(Singleton);
+
+ if (update == null || update.IsUpdatable)
+ {
+ AddOperation(item, OperationType.Put);
+ }
+ }
+
+ ///
+ protected override void Initialize(ODataContext context, ODataPath path)
+ {
+ base.Initialize(context, path);
+
+ // The first segment could be an entity set segment or a singleton segment.
+ ODataNavigationSourceSegment navigationSourceSegment = path.FirstSegment as ODataNavigationSourceSegment;
+
+ EntitySet = navigationSourceSegment.NavigationSource as IEdmEntitySet;
+ if (EntitySet == null)
+ {
+ Singleton = navigationSourceSegment.NavigationSource as IEdmSingleton;
+ }
+ }
+ }
+}
diff --git a/src/Microsoft.OpenApi.OData.Reader/PathItem/PathItemHandler.cs b/src/Microsoft.OpenApi.OData.Reader/PathItem/PathItemHandler.cs
index a65bd827..eff041bc 100644
--- a/src/Microsoft.OpenApi.OData.Reader/PathItem/PathItemHandler.cs
+++ b/src/Microsoft.OpenApi.OData.Reader/PathItem/PathItemHandler.cs
@@ -80,7 +80,7 @@ protected virtual void SetExtensions(OpenApiPathItem item)
/// Add one operation into path item.
///
/// The path item.
- /// The operatin type.
+ /// The operation type.
protected virtual void AddOperation(OpenApiPathItem item, OperationType operationType)
{
IOperationHandlerProvider provider = Context.OperationHanderProvider;
diff --git a/src/Microsoft.OpenApi.OData.Reader/PathItem/PathItemHandlerProvider.cs b/src/Microsoft.OpenApi.OData.Reader/PathItem/PathItemHandlerProvider.cs
index 380fbdcb..5cf3d570 100644
--- a/src/Microsoft.OpenApi.OData.Reader/PathItem/PathItemHandlerProvider.cs
+++ b/src/Microsoft.OpenApi.OData.Reader/PathItem/PathItemHandlerProvider.cs
@@ -36,6 +36,9 @@ internal class PathItemHandlerProvider : IPathItemHandlerProvider
// Edm Ref
{ ODataPathKind.Ref, new RefPathItemHandler() },
+ // Media Entity
+ {ODataPathKind.MediaEntity, new MediaEntityPathItemHandler() },
+
// Unknown
{ ODataPathKind.Unknown, null },
};
diff --git a/src/Microsoft.OpenApi.OData.Reader/PathItem/RefPathItemHandler.cs b/src/Microsoft.OpenApi.OData.Reader/PathItem/RefPathItemHandler.cs
index 64356621..60a18bf2 100644
--- a/src/Microsoft.OpenApi.OData.Reader/PathItem/RefPathItemHandler.cs
+++ b/src/Microsoft.OpenApi.OData.Reader/PathItem/RefPathItemHandler.cs
@@ -90,15 +90,15 @@ protected override void SetOperations(OpenApiPathItem item)
UpdateRestrictionsType update = restriction?.UpdateRestrictions;
if (update == null || update.IsUpdatable)
{
- AddOperation(item, OperationType.Patch);
+ AddOperation(item, OperationType.Put);
}
- }
- // delete the link
- DeleteRestrictionsType delete = restriction?.DeleteRestrictions;
- if (delete == null || delete.IsDeletable)
- {
- AddOperation(item, OperationType.Delete);
+ // delete the link
+ DeleteRestrictionsType delete = restriction?.DeleteRestrictions;
+ if (delete == null || delete.IsDeletable)
+ {
+ AddOperation(item, OperationType.Delete);
+ }
}
}
diff --git a/src/Microsoft.OpenApi.OData.Reader/Vocabulary/Capabilities/CapabilitiesConstants.cs b/src/Microsoft.OpenApi.OData.Reader/Vocabulary/Capabilities/CapabilitiesConstants.cs
index 11d5d493..2cd980f7 100644
--- a/src/Microsoft.OpenApi.OData.Reader/Vocabulary/Capabilities/CapabilitiesConstants.cs
+++ b/src/Microsoft.OpenApi.OData.Reader/Vocabulary/Capabilities/CapabilitiesConstants.cs
@@ -94,5 +94,10 @@ internal class CapabilitiesConstants
/// Org.OData.Capabilities.V1.KeyAsSegmentSupported
///
public const string KeyAsSegmentSupported = "Org.OData.Capabilities.V1.KeyAsSegmentSupported";
+
+ ///
+ /// Org.OData.Core.V1.AcceptableMediaTypes
+ ///
+ public const string AcceptableMediaTypes = "Org.OData.Core.V1.AcceptableMediaTypes";
}
}
diff --git a/src/OoasGui/OoasGui.csproj b/src/OoasGui/OoasGui.csproj
index be7423f9..b1db143b 100644
--- a/src/OoasGui/OoasGui.csproj
+++ b/src/OoasGui/OoasGui.csproj
@@ -35,8 +35,8 @@
..\..\packages\Microsoft.OData.Edm.7.6.1\lib\portable-net45+win8+wpa81\Microsoft.OData.Edm.dll
-
- ..\..\packages\Microsoft.OpenApi.1.1.4\lib\net46\Microsoft.OpenApi.dll
+
+ ..\..\packages\Microsoft.OpenApi.1.2.2\lib\net46\Microsoft.OpenApi.dll
diff --git a/src/OoasGui/packages.config b/src/OoasGui/packages.config
index 5c396329..89e60b5b 100644
--- a/src/OoasGui/packages.config
+++ b/src/OoasGui/packages.config
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataPathProviderTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataPathProviderTests.cs
index e17177af..e189e94a 100644
--- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataPathProviderTests.cs
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataPathProviderTests.cs
@@ -4,13 +4,12 @@
// ------------------------------------------------------------
using System;
-using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml;
+using System.Xml.Linq;
using Microsoft.OData.Edm;
using Microsoft.OData.Edm.Csdl;
-using Microsoft.OData.Edm.Validation;
using Microsoft.OpenApi.OData.Tests;
using Xunit;
@@ -45,7 +44,7 @@ public void GetPathsForGraphBetaModelReturnsAllPaths()
// Assert
Assert.NotNull(paths);
- Assert.Equal(4583, paths.Count());
+ Assert.Equal(4544, paths.Count());
}
[Fact]
@@ -84,7 +83,7 @@ public void GetPathsWithSingletonWorks()
public void GetPathsWithBoundFunctionOperationWorks()
{
// Arrange
- string boundFunction =
+ string boundFunction =
@"
@@ -150,7 +149,7 @@ public void GetPathsWithUnboundOperationImportWorks()
}
[Fact]
- public void GetPathsWithNavigationPropertytWorks()
+ public void GetPathsWithNonContainedNavigationPropertytWorks()
{
// Arrange
string entityType =
@@ -172,16 +171,83 @@ public void GetPathsWithNavigationPropertytWorks()
// Assert
Assert.NotNull(paths);
- Assert.Equal(9, paths.Count());
+ Assert.Equal(8, paths.Count());
var pathItems = paths.Select(p => p.GetPathItemName()).ToList();
Assert.Contains("/Orders({id})/MultipleCustomers", pathItems);
- Assert.Contains("/Orders({id})/MultipleCustomers({ID})", pathItems);
Assert.Contains("/Orders({id})/SingleCustomer", pathItems);
Assert.Contains("/Orders({id})/SingleCustomer/$ref", pathItems);
Assert.Contains("/Orders({id})/MultipleCustomers/$ref", pathItems);
}
+ [Fact]
+ public void GetPathsWithContainedNavigationPropertytWorks()
+ {
+ // Arrange
+ string entityType =
+@"
+
+
+
+
+
+ ";
+
+ string entitySet = @"";
+ IEdmModel model = GetEdmModel(entityType, entitySet);
+ ODataPathProvider provider = new ODataPathProvider();
+
+ // Act
+ var paths = provider.GetPaths(model);
+
+ // Assert
+ Assert.NotNull(paths);
+ Assert.Equal(7, paths.Count());
+
+ var pathItems = paths.Select(p => p.GetPathItemName()).ToList();
+ Assert.Contains("/Orders({id})/MultipleCustomers", pathItems);
+ Assert.Contains("/Orders({id})/MultipleCustomers({ID})", pathItems);
+ Assert.Contains("/Orders({id})/SingleCustomer", pathItems);
+ }
+
+ [Theory]
+ [InlineData(true, "Logo")]
+ [InlineData(false, "Logo")]
+ [InlineData(true, "Content")]
+ [InlineData(false, "Content")]
+ public void GetPathsWithStreamPropertyAndWithEntityHasStreamWorks(bool hasStream, string streamPropName)
+ {
+ // Arrange
+ IEdmModel model = GetEdmModel(hasStream, streamPropName);
+ ODataPathProvider provider = new ODataPathProvider();
+
+ // Act
+ var paths = provider.GetPaths(model);
+
+ // Assert
+ Assert.NotNull(paths);
+
+ if (hasStream && !streamPropName.Equals("Content", StringComparison.OrdinalIgnoreCase))
+ {
+ Assert.Equal(7, paths.Count());
+ Assert.Equal(new[] { "/me", "/me/photo", "/me/photo/$value", "/Todos", "/Todos({Id})", "/Todos({Id})/$value", "/Todos({Id})/Logo" },
+ paths.Select(p => p.GetPathItemName()));
+ }
+ else if ((hasStream && streamPropName.Equals("Content", StringComparison.OrdinalIgnoreCase)) ||
+ (!hasStream && streamPropName.Equals("Content", StringComparison.OrdinalIgnoreCase)))
+ {
+ Assert.Equal(6, paths.Count());
+ Assert.Equal(new[] { "/me", "/me/photo", "/me/photo/$value", "/Todos", "/Todos({Id})", "/Todos({Id})/Content" },
+ paths.Select(p => p.GetPathItemName()));
+ }
+ else // !hasStream && !streamPropName.Equals("Content")
+ {
+ Assert.Equal(6, paths.Count());
+ Assert.Equal(new[] { "/me", "/me/photo", "/me/photo/$value", "/Todos", "/Todos({Id})", "/Todos({Id})/Logo"},
+ paths.Select(p => p.GetPathItemName()));
+ }
+ }
+
private static IEdmModel GetEdmModel(string schemaElement, string containerElement)
{
string template = @"
@@ -198,12 +264,43 @@ private static IEdmModel GetEdmModel(string schemaElement, string containerEleme
{1}
";
- string schema = String.Format(template, schemaElement, containerElement);
- IEdmModel parsedModel;
- IEnumerable errors;
- bool parsed = SchemaReader.TryParse(new XmlReader[] { XmlReader.Create(new StringReader(schema)) }, out parsedModel, out errors);
+ string schema = string.Format(template, schemaElement, containerElement);
+ bool parsed = SchemaReader.TryParse(new XmlReader[] { XmlReader.Create(new StringReader(schema)) }, out IEdmModel parsedModel, out _);
Assert.True(parsed);
return parsedModel;
}
+
+ private static IEdmModel GetEdmModel(bool hasStream, string streamPropName)
+ {
+ string template = @"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+";
+ string modelText = string.Format(template, hasStream, streamPropName);
+ bool result = CsdlReader.TryParse(XElement.Parse(modelText).CreateReader(), out IEdmModel model, out _);
+ Assert.True(result);
+ return model;
+ }
}
}
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataPathTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataPathTests.cs
index 255d95d9..57045cda 100644
--- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataPathTests.cs
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataPathTests.cs
@@ -105,7 +105,7 @@ public void ODataPathLastSegmentWorks()
}
[Fact]
- public void KindPropertyReturnsUnknow()
+ public void KindPropertyReturnsUnknown()
{
// Arrange
ODataKeySegment keySegment = new ODataKeySegment(_simpleKeyEntityType);
@@ -198,6 +198,32 @@ public void KindPropertyReturnsOperationImport()
Assert.Equal(ODataPathKind.OperationImport, path.Kind);
}
+ [Fact]
+ public void KindPropertyReturnsStreamProperty()
+ {
+ // Arrange
+ ODataNavigationSourceSegment nsSegment = new ODataNavigationSourceSegment(_simpleKeyEntitySet);
+ ODataKeySegment keySegment = new ODataKeySegment(_simpleKeyEntityType);
+ ODataStreamPropertySegment streamPropSegment = new ODataStreamPropertySegment("Logo");
+ ODataPath path = new ODataPath(nsSegment, keySegment, streamPropSegment);
+
+ // Act & Assert
+ Assert.Equal(ODataPathKind.MediaEntity, path.Kind);
+ }
+
+ [Fact]
+ public void KindPropertyReturnsStreamContent()
+ {
+ // Arrange
+ ODataNavigationSourceSegment nsSegment = new ODataNavigationSourceSegment(_simpleKeyEntitySet);
+ ODataKeySegment keySegment = new ODataKeySegment(_simpleKeyEntityType);
+ ODataStreamContentSegment streamContSegment = new ODataStreamContentSegment();
+ ODataPath path = new ODataPath(nsSegment, keySegment, streamContSegment);
+
+ // Act & Assert
+ Assert.Equal(ODataPathKind.MediaEntity, path.Kind);
+ }
+
[Theory]
[InlineData(true, true, "/Orders/{Order-Id}")]
[InlineData(true, false, "/Orders/{Id}")]
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataStreamContentSegmentTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataStreamContentSegmentTests.cs
new file mode 100644
index 00000000..92439491
--- /dev/null
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataStreamContentSegmentTests.cs
@@ -0,0 +1,57 @@
+// ------------------------------------------------------------
+// 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;
+using Xunit;
+
+namespace Microsoft.OpenApi.OData.Edm.Tests
+{
+ public class ODataStreamContentSegmentTests
+ {
+ private readonly EdmEntityType _todo;
+
+ public ODataStreamContentSegmentTests()
+ {
+ _todo = new EdmEntityType("microsoft.graph", "Todo",
+ new EdmEntityType("microsoft.graph", "Task"),
+ isAbstract: false,
+ isOpen: false,
+ hasStream: true);
+ _todo.AddKeys(_todo.AddStructuralProperty("Id", EdmPrimitiveTypeKind.String));
+ _todo.AddKeys(_todo.AddStructuralProperty("Logo", EdmPrimitiveTypeKind.Stream));
+ _todo.AddKeys(_todo.AddStructuralProperty("Description", EdmPrimitiveTypeKind.String));
+ }
+
+ [Fact]
+ public void StreamContentSegmentIdentifierPropertyReturnsCorrectDefaultValue()
+ {
+ // Arrange & Act
+ ODataStreamContentSegment segment = new ODataStreamContentSegment();
+
+ // Assert
+ Assert.Same("$value", segment.Identifier);
+ }
+
+ [Fact]
+ public void KindPropertyReturnsStreamContentEnumMember()
+ {
+ // Arrange & Act
+ ODataStreamContentSegment segment = new ODataStreamContentSegment();
+
+ // Assert
+ Assert.Equal(ODataSegmentKind.StreamContent, segment.Kind);
+ }
+
+ [Fact]
+ public void GetPathItemNameReturnsCorrectDefaultStreamContentValue()
+ {
+ // Arrange & Act
+ ODataStreamContentSegment segment = new ODataStreamContentSegment();
+
+ // Assert
+ Assert.Equal("$value", segment.GetPathItemName(new OpenApiConvertSettings()));
+ }
+ }
+}
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataStreamPropertySegmentTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataStreamPropertySegmentTests.cs
new file mode 100644
index 00000000..d5858a1b
--- /dev/null
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataStreamPropertySegmentTests.cs
@@ -0,0 +1,70 @@
+// ------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
+// ------------------------------------------------------------
+
+using System;
+using System.Linq;
+using Microsoft.OData.Edm;
+using Xunit;
+
+namespace Microsoft.OpenApi.OData.Edm.Tests
+{
+ public class ODataStreamPropertySegmentTests
+ {
+ private readonly EdmEntityType _todo;
+
+ public ODataStreamPropertySegmentTests()
+ {
+ _todo = new EdmEntityType("microsoft.graph", "Todo");
+ _todo.AddKeys(_todo.AddStructuralProperty("Id", EdmPrimitiveTypeKind.String));
+ _todo.AddKeys(_todo.AddStructuralProperty("Logo", EdmPrimitiveTypeKind.Stream));
+ _todo.AddKeys(_todo.AddStructuralProperty("Description", EdmPrimitiveTypeKind.String));
+ }
+
+ [Fact]
+ public void StreamPropertySegmentConstructorThrowsArgumentNull()
+ {
+ Assert.Throws("streamPropertyName", () => new ODataStreamPropertySegment(null));
+ }
+
+ [Fact]
+ public void StreamPropertySegmentIdentifierPropertyReturnsStreamPropertyNameOfEntity()
+ {
+ // Arrange
+ var streamPropName = _todo.DeclaredStructuralProperties().First(c => c.Name == "Logo").Name;
+
+ // Act
+ ODataStreamPropertySegment segment = new ODataStreamPropertySegment(streamPropName);
+
+ // Assert
+ Assert.Same(streamPropName, segment.Identifier);
+ }
+
+ [Fact]
+ public void KindPropertyReturnsStreamPropertyEnumMember()
+ {
+ // Arrange
+ var streamPropName = _todo.DeclaredStructuralProperties().First(c => c.Name == "Logo").Name;
+
+ // Act
+ ODataStreamPropertySegment segment = new ODataStreamPropertySegment(streamPropName);
+
+ // Assert
+ Assert.Equal(ODataSegmentKind.StreamProperty, segment.Kind);
+ }
+
+ [Fact]
+ public void GetPathItemNameReturnsCorrectStreamPropertyNameOfEntity()
+ {
+ // Arrange
+ var streamPropName = _todo.DeclaredStructuralProperties().First(c => c.Name == "Logo").Name;
+
+ // Act
+ ODataStreamPropertySegment segment = new ODataStreamPropertySegment(streamPropName);
+
+ // Assert
+ Assert.Equal(streamPropName, segment.GetPathItemName(new OpenApiConvertSettings()));
+ }
+ }
+}
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Microsoft.OpenAPI.OData.Reader.Tests.csproj b/test/Microsoft.OpenAPI.OData.Reader.Tests/Microsoft.OpenAPI.OData.Reader.Tests.csproj
index a9b3b4be..d24893f3 100644
--- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Microsoft.OpenAPI.OData.Reader.Tests.csproj
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Microsoft.OpenAPI.OData.Reader.Tests.csproj
@@ -62,7 +62,7 @@
-
+
all
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EntitySetGetOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EntitySetGetOperationHandlerTests.cs
index 6529d9f3..32aa2f6f 100644
--- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EntitySetGetOperationHandlerTests.cs
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EntitySetGetOperationHandlerTests.cs
@@ -346,12 +346,9 @@ public static IEdmModel GetEdmModel(string annotation)
";
- string modelText = string.Format(template, annotation);
-
- IEdmModel model;
- IEnumerable errors;
- bool result = CsdlReader.TryParse(XElement.Parse(modelText).CreateReader(), out model, out errors);
+ string modelText = string.Format(template, annotation);
+ bool result = CsdlReader.TryParse(XElement.Parse(modelText).CreateReader(), out IEdmModel model, out _);
Assert.True(result);
return model;
}
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EntitySetPostOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EntitySetPostOperationHandlerTests.cs
index ad15568d..3417518e 100644
--- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EntitySetPostOperationHandlerTests.cs
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EntitySetPostOperationHandlerTests.cs
@@ -4,10 +4,14 @@
// ------------------------------------------------------------
using Microsoft.OData.Edm;
+using Microsoft.OData.Edm.Csdl;
using Microsoft.OpenApi.Extensions;
using Microsoft.OpenApi.Models;
+using Microsoft.OpenApi.OData.Common;
using Microsoft.OpenApi.OData.Edm;
using Microsoft.OpenApi.OData.Tests;
+using Microsoft.OpenApi.OData.Vocabulary.Capabilities;
+using System.Xml.Linq;
using Xunit;
namespace Microsoft.OpenApi.OData.Operation.Tests
@@ -17,12 +21,30 @@ public class EntitySetPostOperationHandlerTests
private EntitySetPostOperationHandler _operationHandler = new EntitySetPostOperationHandler();
[Theory]
- [InlineData(true)]
- [InlineData(false)]
- public void CreateEntitySetPostOperationReturnsCorrectOperation(bool enableOperationId)
+ [InlineData(true, true)]
+ [InlineData(false, true)]
+ [InlineData(true, false)]
+ [InlineData(false, false)]
+ public void CreateEntitySetPostOperationReturnsCorrectOperation(bool enableOperationId, bool hasStream)
{
// Arrange
- IEdmModel model = EntitySetGetOperationHandlerTests.GetEdmModel("");
+ string qualifiedName = CapabilitiesConstants.AcceptableMediaTypes;
+ string annotation = $@"
+
+
+ application/todo
+
+ ";
+
+ // Assert
+ VerifyEntitySetPostOperation("", enableOperationId, hasStream);
+ VerifyEntitySetPostOperation(annotation, enableOperationId, hasStream);
+ }
+
+ private void VerifyEntitySetPostOperation(string annotation, bool enableOperationId, bool hasStream)
+ {
+ // Arrange
+ IEdmModel model = GetEdmModel(annotation, hasStream);
IEdmEntitySet entitySet = model.EntityContainer.FindEntitySet("Customers");
OpenApiConvertSettings settings = new OpenApiConvertSettings
{
@@ -47,6 +69,47 @@ public void CreateEntitySetPostOperationReturnsCorrectOperation(bool enableOpera
Assert.NotNull(post.Responses);
Assert.Equal(2, post.Responses.Count);
+ if (hasStream)
+ {
+ Assert.NotNull(post.RequestBody);
+
+ if (!string.IsNullOrEmpty(annotation))
+ {
+ // RequestBody
+ Assert.Equal(2, post.RequestBody.Content.Keys.Count);
+ Assert.True(post.RequestBody.Content.ContainsKey("application/todo"));
+ Assert.True(post.RequestBody.Content.ContainsKey(Constants.ApplicationJsonMediaType));
+
+ // Response
+ Assert.Equal(2, post.Responses[Constants.StatusCode201].Content.Keys.Count);
+ Assert.True(post.Responses[Constants.StatusCode201].Content.ContainsKey("application/todo"));
+ Assert.True(post.Responses[Constants.StatusCode201].Content.ContainsKey(Constants.ApplicationJsonMediaType));
+ }
+ else
+ {
+ // RequestBody
+ Assert.Equal(2, post.RequestBody.Content.Keys.Count);
+ Assert.True(post.RequestBody.Content.ContainsKey(Constants.ApplicationOctetStreamMediaType));
+ Assert.True(post.RequestBody.Content.ContainsKey(Constants.ApplicationJsonMediaType));
+
+ // Response
+ Assert.Equal(2, post.Responses[Constants.StatusCode201].Content.Keys.Count);
+ Assert.True(post.Responses[Constants.StatusCode201].Content.ContainsKey(Constants.ApplicationOctetStreamMediaType));
+ Assert.True(post.Responses[Constants.StatusCode201].Content.ContainsKey(Constants.ApplicationJsonMediaType));
+ }
+ }
+ else
+ {
+ // RequestBody
+ Assert.NotNull(post.RequestBody);
+ Assert.Equal(1, post.RequestBody.Content.Keys.Count);
+ Assert.True(post.RequestBody.Content.ContainsKey(Constants.ApplicationJsonMediaType));
+
+ // Response
+ Assert.Equal(1, post.Responses[Constants.StatusCode201].Content.Keys.Count);
+ Assert.True(post.Responses[Constants.StatusCode201].Content.ContainsKey(Constants.ApplicationJsonMediaType));
+ }
+
if (enableOperationId)
{
Assert.Equal("Customers.Customer.CreateCustomer", post.OperationId);
@@ -164,5 +227,32 @@ public void CreateEntitySetPostReturnsSecurityForInsertRestrictions(bool enableA
Assert.Empty(post.Security);
}
}
+
+ private static IEdmModel GetEdmModel(string annotation, bool hasStream = false)
+ {
+ const string template = @"
+
+
+
+
+
+
+
+
+
+
+
+
+ {1}
+
+
+
+";
+
+ string modelText = string.Format(template, hasStream, annotation);
+ bool result = CsdlReader.TryParse(XElement.Parse(modelText).CreateReader(), out IEdmModel model, out _);
+ Assert.True(result);
+ return model;
+ }
}
}
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/MediaEntityGetOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/MediaEntityGetOperationHandlerTests.cs
new file mode 100644
index 00000000..c26574a5
--- /dev/null
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/MediaEntityGetOperationHandlerTests.cs
@@ -0,0 +1,158 @@
+// ------------------------------------------------------------
+// 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;
+using Microsoft.OData.Edm.Csdl;
+using Microsoft.OpenApi.OData.Common;
+using Microsoft.OpenApi.OData.Edm;
+using Microsoft.OpenApi.OData.Vocabulary.Capabilities;
+using System.Linq;
+using System.Xml.Linq;
+using Xunit;
+
+namespace Microsoft.OpenApi.OData.Operation.Tests
+{
+ public class MediaEntityGetOperationHandlerTests
+ {
+ private readonly MediaEntityGetOperationHandler _operationalHandler = new MediaEntityGetOperationHandler();
+
+ [Theory]
+ [InlineData(true)]
+ [InlineData(false)]
+ public void CreateMediaEntityGetOperationReturnsCorrectOperation(bool enableOperationId)
+ {
+ // Arrange
+ string qualifiedName = CapabilitiesConstants.AcceptableMediaTypes;
+ string annotation = $@"
+
+
+ image/png
+ image/jpeg
+
+ ";
+
+ // Assert
+ VerifyMediaEntityGetOperation("", enableOperationId);
+ VerifyMediaEntityGetOperation(annotation, enableOperationId);
+ }
+
+ private void VerifyMediaEntityGetOperation(string annotation, bool enableOperationId)
+ {
+ // Arrange
+ IEdmModel model = GetEdmModel(annotation);
+ OpenApiConvertSettings settings = new OpenApiConvertSettings
+ {
+ EnableOperationId = enableOperationId
+ };
+
+ ODataContext context = new ODataContext(model, settings);
+ IEdmEntitySet todos = model.EntityContainer.FindEntitySet("Todos");
+ IEdmSingleton me = model.EntityContainer.FindSingleton("me");
+ Assert.NotNull(todos);
+ Assert.NotNull(me);
+
+ IEdmEntityType todo = model.SchemaElements.OfType().First(c => c.Name == "Todo");
+ IEdmStructuralProperty sp = todo.DeclaredStructuralProperties().First(c => c.Name == "Logo");
+ ODataPath path = new ODataPath(new ODataNavigationSourceSegment(todos),
+ new ODataKeySegment(todos.EntityType()),
+ new ODataStreamPropertySegment(sp.Name));
+
+ IEdmEntityType user = model.SchemaElements.OfType().First(c => c.Name == "user");
+ IEdmNavigationProperty navProperty = user.DeclaredNavigationProperties().First(c => c.Name == "photo");
+ ODataPath path2 = new ODataPath(new ODataNavigationSourceSegment(me),
+ new ODataNavigationPropertySegment(navProperty),
+ new ODataStreamContentSegment());
+
+ // Act
+ var getOperation = _operationalHandler.CreateOperation(context, path);
+ var getOperation2 = _operationalHandler.CreateOperation(context, path2);
+
+ // Assert
+ Assert.NotNull(getOperation);
+ Assert.NotNull(getOperation2);
+ Assert.Equal("Get media content for Todo from Todos", getOperation.Summary);
+ Assert.Equal("Get media content for the navigation property photo from me", getOperation2.Summary);
+ Assert.NotNull(getOperation.Tags);
+ Assert.NotNull(getOperation2.Tags);
+
+ var tag = Assert.Single(getOperation.Tags);
+ var tag2 = Assert.Single(getOperation2.Tags);
+ Assert.Equal("Todos.Todo", tag.Name);
+ Assert.Equal("me.profilePhoto", tag2.Name);
+
+ Assert.NotNull(getOperation.Responses);
+ Assert.NotNull(getOperation2.Responses);
+ Assert.Equal(2, getOperation.Responses.Count);
+ Assert.Equal(2, getOperation2.Responses.Count);
+ Assert.Equal(new[] { "200", "default" }, getOperation.Responses.Select(r => r.Key));
+ Assert.Equal(new[] { "200", "default" }, getOperation2.Responses.Select(r => r.Key));
+
+ if (!string.IsNullOrEmpty(annotation))
+ {
+ Assert.Equal(2, getOperation.Responses[Constants.StatusCode200].Content.Keys.Count);
+ Assert.True(getOperation.Responses[Constants.StatusCode200].Content.ContainsKey("image/png"));
+ Assert.True(getOperation.Responses[Constants.StatusCode200].Content.ContainsKey("image/jpeg"));
+
+ Assert.Equal(1, getOperation2.Responses[Constants.StatusCode200].Content.Keys.Count);
+ Assert.True(getOperation2.Responses[Constants.StatusCode200].Content.ContainsKey(Constants.ApplicationOctetStreamMediaType));
+ }
+ else
+ {
+ Assert.Equal(1, getOperation.Responses[Constants.StatusCode200].Content.Keys.Count);
+ Assert.Equal(1, getOperation2.Responses[Constants.StatusCode200].Content.Keys.Count);
+ Assert.True(getOperation.Responses[Constants.StatusCode200].Content.ContainsKey(Constants.ApplicationOctetStreamMediaType));
+ Assert.True(getOperation2.Responses[Constants.StatusCode200].Content.ContainsKey(Constants.ApplicationOctetStreamMediaType));
+ }
+
+ if (enableOperationId)
+ {
+ Assert.Equal("Todos.Todo.GetLogo", getOperation.OperationId);
+ Assert.Equal("me.GetPhotoContent", getOperation2.OperationId);
+ }
+ else
+ {
+ Assert.Null(getOperation.OperationId);
+ Assert.Null(getOperation2.OperationId);
+ }
+ }
+
+ public static IEdmModel GetEdmModel(string annotation)
+ {
+ const string template = @"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {0}
+
+
+
+";
+ string modelText = string.Format(template, annotation);
+
+ bool result = CsdlReader.TryParse(XElement.Parse(modelText).CreateReader(), out IEdmModel model, out _);
+ Assert.True(result);
+ return model;
+ }
+ }
+}
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/MediaEntityPutOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/MediaEntityPutOperationHandlerTests.cs
new file mode 100644
index 00000000..7ec79556
--- /dev/null
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/MediaEntityPutOperationHandlerTests.cs
@@ -0,0 +1,118 @@
+// ------------------------------------------------------------
+// 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;
+using Microsoft.OpenApi.OData.Common;
+using Microsoft.OpenApi.OData.Edm;
+using Microsoft.OpenApi.OData.Vocabulary.Capabilities;
+using System.Linq;
+using Xunit;
+
+namespace Microsoft.OpenApi.OData.Operation.Tests
+{
+ public class MediaEntityPutOperationHandlerTests
+ {
+ private readonly MediaEntityPutOperationHandler _operationalHandler = new MediaEntityPutOperationHandler();
+
+ [Theory]
+ [InlineData(true)]
+ [InlineData(false)]
+ public void CreateMediaEntityPutOperationReturnsCorrectOperation(bool enableOperationId)
+ {
+ // Arrange
+ string qualifiedName = CapabilitiesConstants.AcceptableMediaTypes;
+ string annotation = $@"
+
+
+ image/png
+ image/jpeg
+
+ ";
+
+ // Assert
+ VerifyMediaEntityPutOperation("", enableOperationId);
+ VerifyMediaEntityPutOperation(annotation, enableOperationId);
+ }
+
+ private void VerifyMediaEntityPutOperation(string annotation, bool enableOperationId)
+ {
+ // Arrange
+ IEdmModel model = MediaEntityGetOperationHandlerTests.GetEdmModel(annotation);
+ OpenApiConvertSettings settings = new OpenApiConvertSettings
+ {
+ EnableOperationId = enableOperationId
+ };
+
+ ODataContext context = new ODataContext(model, settings);
+ IEdmEntitySet todos = model.EntityContainer.FindEntitySet("Todos");
+ IEdmSingleton me = model.EntityContainer.FindSingleton("me");
+ Assert.NotNull(todos);
+
+ IEdmEntityType todo = model.SchemaElements.OfType().First(c => c.Name == "Todo");
+ IEdmStructuralProperty sp = todo.DeclaredStructuralProperties().First(c => c.Name == "Logo");
+ ODataPath path = new ODataPath(new ODataNavigationSourceSegment(todos),
+ new ODataKeySegment(todos.EntityType()),
+ new ODataStreamPropertySegment(sp.Name));
+
+ IEdmEntityType user = model.SchemaElements.OfType().First(c => c.Name == "user");
+ IEdmNavigationProperty navProperty = user.DeclaredNavigationProperties().First(c => c.Name == "photo");
+ ODataPath path2 = new ODataPath(new ODataNavigationSourceSegment(me),
+ new ODataNavigationPropertySegment(navProperty),
+ new ODataStreamContentSegment());
+
+ // Act
+ var putOperation = _operationalHandler.CreateOperation(context, path);
+ var putOperation2 = _operationalHandler.CreateOperation(context, path2);
+
+ // Assert
+ Assert.NotNull(putOperation);
+ Assert.NotNull(putOperation2);
+ Assert.Equal("Update media content for Todo in Todos", putOperation.Summary);
+ Assert.Equal("Update media content for the navigation property photo in me", putOperation2.Summary);
+ Assert.NotNull(putOperation.Tags);
+ Assert.NotNull(putOperation2.Tags);
+
+ var tag = Assert.Single(putOperation.Tags);
+ var tag2 = Assert.Single(putOperation2.Tags);
+ Assert.Equal("Todos.Todo", tag.Name);
+ Assert.Equal("me.profilePhoto", tag2.Name);
+
+ Assert.NotNull(putOperation.Responses);
+ Assert.NotNull(putOperation2.Responses);
+ Assert.Equal(2, putOperation.Responses.Count);
+ Assert.Equal(2, putOperation2.Responses.Count);
+ Assert.Equal(new[] { "204", "default" }, putOperation.Responses.Select(r => r.Key));
+ Assert.Equal(new[] { "204", "default" }, putOperation2.Responses.Select(r => r.Key));
+
+ if (!string.IsNullOrEmpty(annotation))
+ {
+ Assert.Equal(2, putOperation.RequestBody.Content.Keys.Count);
+ Assert.True(putOperation.RequestBody.Content.ContainsKey("image/png"));
+ Assert.True(putOperation.RequestBody.Content.ContainsKey("image/jpeg"));
+
+ Assert.Equal(1, putOperation2.RequestBody.Content.Keys.Count);
+ Assert.True(putOperation2.RequestBody.Content.ContainsKey(Constants.ApplicationOctetStreamMediaType));
+ }
+ else
+ {
+ Assert.Equal(1, putOperation.RequestBody.Content.Keys.Count);
+ Assert.Equal(1, putOperation2.RequestBody.Content.Keys.Count);
+ Assert.True(putOperation.RequestBody.Content.ContainsKey(Constants.ApplicationOctetStreamMediaType));
+ Assert.True(putOperation2.RequestBody.Content.ContainsKey(Constants.ApplicationOctetStreamMediaType));
+ }
+
+ if (enableOperationId)
+ {
+ Assert.Equal("Todos.Todo.UpdateLogo", putOperation.OperationId);
+ Assert.Equal("me.UpdatePhotoContent", putOperation2.OperationId);
+ }
+ else
+ {
+ Assert.Null(putOperation.OperationId);
+ Assert.Null(putOperation2.OperationId);
+ }
+ }
+ }
+}
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/OperationHandlerProviderTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/OperationHandlerProviderTests.cs
index 942cfdd7..f28668d4 100644
--- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/OperationHandlerProviderTests.cs
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/OperationHandlerProviderTests.cs
@@ -31,7 +31,9 @@ public class OperationHandlerProviderTests
[InlineData(ODataPathKind.Ref, OperationType.Post, typeof(RefPostOperationHandler))]
[InlineData(ODataPathKind.Ref, OperationType.Delete, typeof(RefDeleteOperationHandler))]
[InlineData(ODataPathKind.Ref, OperationType.Get, typeof(RefGetOperationHandler))]
- [InlineData(ODataPathKind.Ref, OperationType.Patch, typeof(RefPatchOperationHandler))]
+ [InlineData(ODataPathKind.Ref, OperationType.Put, typeof(RefPutOperationHandler))]
+ [InlineData(ODataPathKind.MediaEntity, OperationType.Get, typeof(MediaEntityGetOperationHandler))]
+ [InlineData(ODataPathKind.MediaEntity, OperationType.Put, typeof(MediaEntityPutOperationHandler))]
public void GetHandlerReturnsCorrectOperationHandlerType(ODataPathKind pathKind, OperationType operationType, Type handlerType)
{
// Arrange
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/RefPatchOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/RefPutOperationHandlerTests.cs
similarity index 88%
rename from test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/RefPatchOperationHandlerTests.cs
rename to test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/RefPutOperationHandlerTests.cs
index cacd40a0..f0333759 100644
--- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/RefPatchOperationHandlerTests.cs
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/RefPutOperationHandlerTests.cs
@@ -4,23 +4,21 @@
// ------------------------------------------------------------
using Microsoft.OData.Edm;
-using Microsoft.OpenApi.Extensions;
using Microsoft.OpenApi.OData.Edm;
-using Microsoft.OpenApi.OData.PathItem.Tests;
using Microsoft.OpenApi.OData.Tests;
using System.Linq;
using Xunit;
namespace Microsoft.OpenApi.OData.Operation.Tests
{
- public class RefPatchOperationHandlerTests
+ public class RefPutOperationHandlerTests
{
- private RefPatchOperationHandler _operationHandler = new RefPatchOperationHandler();
+ private RefPutOperationHandler _operationHandler = new RefPutOperationHandler();
[Theory]
[InlineData(true)]
[InlineData(false)]
- public void CreateNavigationRefPatchOperationReturnsCorrectOperation(bool enableOperationId)
+ public void CreateNavigationRefPutOperationReturnsCorrectOperation(bool enableOperationId)
{
// Arrange
IEdmModel model = EdmModelHelper.TripServiceModel;
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/MediaEntityPathItemHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/MediaEntityPathItemHandlerTests.cs
new file mode 100644
index 00000000..ee20c584
--- /dev/null
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/MediaEntityPathItemHandlerTests.cs
@@ -0,0 +1,248 @@
+// ------------------------------------------------------------
+// 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;
+using Microsoft.OData.Edm.Csdl;
+using Microsoft.OpenApi.Models;
+using Microsoft.OpenApi.OData.Edm;
+using Microsoft.OpenApi.OData.Properties;
+using System;
+using System.Linq;
+using System.Xml.Linq;
+using Xunit;
+
+namespace Microsoft.OpenApi.OData.PathItem.Tests
+{
+ public class MediaEntityPathItemHandlerTests
+ {
+ private readonly MediaEntityPathItemHandler _pathItemHandler = new MyMediaEntityPathItemHandler();
+
+ [Fact]
+ public void CreatePathItemThrowsForNullContext()
+ {
+ // Arrange & Act & Assert
+ Assert.Throws("context",
+ () => _pathItemHandler.CreatePathItem(context: null, path: new ODataPath()));
+ }
+
+ [Fact]
+ public void CreatePathItemThrowsForNullPath()
+ {
+ // Arrange & Act & Assert
+ Assert.Throws("path",
+ () => _pathItemHandler.CreatePathItem(new ODataContext(EdmCoreModel.Instance), path: null));
+ }
+
+ [Fact]
+ public void CreatePathItemThrowsForNonMediaEntityPath()
+ {
+ // Arrange
+ IEdmModel model = GetEdmModel("");
+ ODataContext context = new ODataContext(model);
+ var entitySet = model.EntityContainer.FindEntitySet("Todos");
+ Assert.NotNull(entitySet); // guard
+ var path = new ODataPath(new ODataNavigationSourceSegment(entitySet));
+
+ // Act
+ void test() => _pathItemHandler.CreatePathItem(context, path);
+
+ // Assert
+ var exception = Assert.Throws(test);
+ Assert.Equal(string.Format(SRResource.InvalidPathKindForPathItemHandler, _pathItemHandler.GetType().Name, path.Kind), exception.Message);
+ }
+
+ [Fact]
+ public void CreateMediaEntityPathItemReturnsCorrectItem()
+ {
+ // Arrange
+ IEdmModel model = GetEdmModel("");
+ ODataContext context = new ODataContext(model);
+ IEdmEntitySet entitySet = model.EntityContainer.FindEntitySet("Todos");
+ IEdmSingleton singleton = model.EntityContainer.FindSingleton("me");
+ Assert.NotNull(entitySet); // guard
+ Assert.NotNull(singleton);
+ IEdmEntityType entityType = entitySet.EntityType();
+
+ IEdmStructuralProperty sp = entityType.DeclaredStructuralProperties().First(c => c.Name == "Logo");
+ ODataPath path = new ODataPath(new ODataNavigationSourceSegment(entitySet),
+ new ODataKeySegment(entityType),
+ new ODataStreamPropertySegment(sp.Name));
+
+ IEdmEntityType user = model.SchemaElements.OfType().First(c => c.Name == "user");
+ IEdmNavigationProperty navProperty = user.DeclaredNavigationProperties().First(c => c.Name == "photo");
+ ODataPath path2 = new ODataPath(new ODataNavigationSourceSegment(singleton),
+ new ODataNavigationPropertySegment(navProperty),
+ new ODataStreamContentSegment());
+
+ // Act
+ var pathItem = _pathItemHandler.CreatePathItem(context, path);
+ var pathItem2 = _pathItemHandler.CreatePathItem(context, path2);
+
+ // Assert
+ Assert.NotNull(pathItem);
+ Assert.NotNull(pathItem2);
+
+ Assert.NotNull(pathItem.Operations);
+ Assert.NotNull(pathItem2.Operations);
+ Assert.NotEmpty(pathItem.Operations);
+ Assert.NotEmpty(pathItem2.Operations);
+ Assert.Equal(2, pathItem.Operations.Count);
+ Assert.Equal(2, pathItem2.Operations.Count);
+ Assert.Equal(new OperationType[] { OperationType.Get, OperationType.Put },
+ pathItem.Operations.Select(o => o.Key));
+ Assert.Equal(new OperationType[] { OperationType.Get, OperationType.Put },
+ pathItem2.Operations.Select(o => o.Key));
+ }
+
+ [Theory]
+ [InlineData(true, new OperationType[] { OperationType.Get, OperationType.Put })]
+ [InlineData(false, new OperationType[] { OperationType.Put })]
+ public void CreateMediaEntityPathItemWorksForReadByKeyRestrictionsCapablities(bool readable, OperationType[] expected)
+ {
+ // Arrange
+ string annotation = $@"
+
+
+
+
+
+
+
+
+";
+
+ // Assert
+ VerifyPathItemOperationsForStreamPropertySegment(annotation, expected);
+ VerifyPathItemOperationsForStreamContentSegment(annotation, expected);
+ }
+
+ [Theory]
+ [InlineData(true, new OperationType[] { OperationType.Get, OperationType.Put })]
+ [InlineData(false, new OperationType[] { OperationType.Get })]
+ public void CreateMediaEntityPathItemWorksForUpdateRestrictionsCapablities(bool updatable, OperationType[] expected)
+ {
+ // Arrange
+ string annotation = $@"
+
+
+
+
+";
+
+ // Assert
+ VerifyPathItemOperationsForStreamPropertySegment(annotation, expected);
+ VerifyPathItemOperationsForStreamContentSegment(annotation, expected);
+ }
+
+ private void VerifyPathItemOperationsForStreamPropertySegment(string annotation, OperationType[] expected)
+ {
+ // Arrange
+ IEdmModel model = GetEdmModel(annotation);
+ ODataContext context = new ODataContext(model);
+ IEdmEntitySet entitySet = model.EntityContainer.FindEntitySet("Todos");
+ Assert.NotNull(entitySet); // guard
+ IEdmEntityType entityType = entitySet.EntityType();
+
+ IEdmStructuralProperty sp = entityType.DeclaredStructuralProperties().First(c => c.Name == "Logo");
+ ODataPath path = new ODataPath(new ODataNavigationSourceSegment(entitySet),
+ new ODataKeySegment(entityType),
+ new ODataStreamPropertySegment(sp.Name));
+
+ // Act
+ var pathItem = _pathItemHandler.CreatePathItem(context, path);
+
+ // Assert
+ Assert.NotNull(pathItem);
+
+ Assert.NotNull(pathItem.Operations);
+ Assert.NotEmpty(pathItem.Operations);
+ Assert.Equal(expected, pathItem.Operations.Select(e => e.Key));
+ }
+
+ private void VerifyPathItemOperationsForStreamContentSegment(string annotation, OperationType[] expected)
+ {
+ // Arrange
+ IEdmModel model = GetEdmModel(annotation);
+ ODataContext context = new ODataContext(model);
+ IEdmEntitySet entitySet = model.EntityContainer.FindEntitySet("Todos");
+ IEdmSingleton singleton = model.EntityContainer.FindSingleton("me");
+ Assert.NotNull(entitySet); // guard
+ Assert.NotNull(singleton);
+ IEdmEntityType entityType = entitySet.EntityType();
+
+ IEdmEntityType user = model.SchemaElements.OfType().First(c => c.Name == "user");
+ IEdmNavigationProperty navProperty = user.DeclaredNavigationProperties().First(c => c.Name == "photo");
+ ODataPath path2 = new ODataPath(new ODataNavigationSourceSegment(singleton),
+ new ODataNavigationPropertySegment(navProperty),
+ new ODataStreamContentSegment());
+
+ ODataPath path = new ODataPath(new ODataNavigationSourceSegment(entitySet),
+ new ODataKeySegment(entityType),
+ new ODataStreamContentSegment());
+
+ // Act
+ var pathItem = _pathItemHandler.CreatePathItem(context, path);
+ var pathItem2 = _pathItemHandler.CreatePathItem(context, path2);
+
+ // Assert
+ Assert.NotNull(pathItem);
+ Assert.NotNull(pathItem2);
+
+ Assert.NotNull(pathItem.Operations);
+ Assert.NotNull(pathItem2.Operations);
+ Assert.NotEmpty(pathItem.Operations);
+ Assert.NotEmpty(pathItem2.Operations);
+ Assert.Equal(expected, pathItem.Operations.Select(e => e.Key));
+ Assert.Equal(expected, pathItem2.Operations.Select(e => e.Key));
+ }
+
+ private IEdmModel GetEdmModel(string annotation)
+ {
+ const string template = @"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {0}
+
+
+ {0}
+
+
+
+";
+ string modelText = string.Format(template, annotation);
+ bool result = CsdlReader.TryParse(XElement.Parse(modelText).CreateReader(), out IEdmModel model, out _);
+ Assert.True(result);
+ return model;
+ }
+ }
+
+ internal class MyMediaEntityPathItemHandler : MediaEntityPathItemHandler
+ {
+ protected override void AddOperation(OpenApiPathItem item, OperationType operationType)
+ {
+ item.AddOperation(operationType, new OpenApiOperation());
+ }
+ }
+}
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/PathItemHandlerProviderTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/PathItemHandlerProviderTests.cs
index 4722b86a..3de9155f 100644
--- a/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/PathItemHandlerProviderTests.cs
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/PathItemHandlerProviderTests.cs
@@ -19,6 +19,7 @@ public class PathItemHandlerProviderTests
[InlineData(ODataPathKind.Operation, typeof(OperationPathItemHandler))]
[InlineData(ODataPathKind.OperationImport, typeof(OperationImportPathItemHandler))]
[InlineData(ODataPathKind.Ref, typeof(RefPathItemHandler))]
+ [InlineData(ODataPathKind.MediaEntity, typeof(MediaEntityPathItemHandler))]
public void GetHandlerReturnsCorrectHandlerType(ODataPathKind pathKind, Type handlerType)
{
// Arrange
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/RefPathItemHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/RefPathItemHandlerTests.cs
index 30869c2a..ee055a43 100644
--- a/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/RefPathItemHandlerTests.cs
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/RefPathItemHandlerTests.cs
@@ -57,8 +57,8 @@ public void CreatePathItemThrowsForNonNavigationPropertyPath()
}
[Theory]
- [InlineData(true, new OperationType[] { OperationType.Get, OperationType.Post, OperationType.Delete })]
- [InlineData(false, new OperationType[] { OperationType.Get, OperationType.Patch, OperationType.Delete })]
+ [InlineData(true, new OperationType[] { OperationType.Get, OperationType.Post})]
+ [InlineData(false, new OperationType[] { OperationType.Get, OperationType.Put, OperationType.Delete })]
public void CreateNavigationPropertyRefPathItemReturnsCorrectPathItem(bool collectionNav, OperationType[] expected)
{
// Arrange
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json
index 0e8b96b8..c88d2f0c 100644
--- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json
@@ -773,96 +773,6 @@
"x-ms-docs-operation-type": "operation"
}
},
- "/Documents({Id})/Revisions({Id1})": {
- "get": {
- "tags": [
- "Documents.RevisionDto"
- ],
- "summary": "Get Revisions from Documents",
- "operationId": "Documents.GetRevisions",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "Id",
- "description": "key: Id of DocumentDto",
- "required": true,
- "type": "integer",
- "format": "int32",
- "maximum": 2147483647,
- "minimum": -2147483648,
- "x-ms-docs-key-type": "DocumentDto"
- },
- {
- "in": "path",
- "name": "Id1",
- "description": "key: Id of RevisionDto",
- "required": true,
- "type": "integer",
- "format": "int32",
- "maximum": 2147483647,
- "minimum": -2147483648,
- "x-ms-docs-key-type": "RevisionDto"
- },
- {
- "in": "query",
- "name": "$select",
- "description": "Select properties to be returned",
- "type": "array",
- "items": {
- "enum": [
- "Id",
- "Number",
- "DocumentId",
- "DocumentName",
- "DocumentDescription",
- "CreationDate",
- "CreatedBy",
- "IsReviewed",
- "ReviewedBy",
- "ReviewedDate",
- "IsApproved",
- "ApprovedBy",
- "ApprovedDate",
- "IsRejected",
- "RejectedBy",
- "RejectedDate",
- "DomainId",
- "Document"
- ],
- "type": "string"
- }
- },
- {
- "in": "query",
- "name": "$expand",
- "description": "Expand related entities",
- "type": "array",
- "items": {
- "enum": [
- "*",
- "Document"
- ],
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Retrieved navigation property",
- "schema": {
- "$ref": "#/definitions/Siterra.Documents.App.DTO.RevisionDto"
- }
- },
- "default": {
- "$ref": "#/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
- }
- },
"/Documents({Id})/Revisions/$ref": {
"get": {
"tags": [
@@ -998,7 +908,10 @@
"description": "New navigation property ref value",
"required": true,
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
],
@@ -1006,7 +919,7 @@
"201": {
"description": "Created navigation property link.",
"schema": {
- "type": "String"
+ "type": "object"
}
},
"default": {
@@ -1014,47 +927,6 @@
}
},
"x-ms-docs-operation-type": "operation"
- },
- "delete": {
- "tags": [
- "Documents.RevisionDto"
- ],
- "summary": "Delete ref of navigation property Revisions for Documents",
- "operationId": "Documents.DeleteRefRevisions",
- "parameters": [
- {
- "in": "path",
- "name": "Id",
- "description": "key: Id of DocumentDto",
- "required": true,
- "type": "integer",
- "format": "int32",
- "maximum": 2147483647,
- "minimum": -2147483648,
- "x-ms-docs-key-type": "DocumentDto"
- },
- {
- "in": "header",
- "name": "If-Match",
- "description": "ETag",
- "type": "string"
- },
- {
- "in": "query",
- "name": "@id",
- "description": "Delete Uri",
- "type": "string"
- }
- ],
- "responses": {
- "204": {
- "description": "Success"
- },
- "default": {
- "$ref": "#/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
}
},
"/Libraries": {
@@ -1503,89 +1375,6 @@
"x-ms-docs-operation-type": "operation"
}
},
- "/Libraries({Id})/Documents({Id1})": {
- "get": {
- "tags": [
- "Libraries.DocumentDto"
- ],
- "summary": "Get Documents from Libraries",
- "operationId": "Libraries.GetDocuments",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "Id",
- "description": "key: Id of LibraryDto",
- "required": true,
- "type": "integer",
- "format": "int32",
- "maximum": 2147483647,
- "minimum": -2147483648,
- "x-ms-docs-key-type": "LibraryDto"
- },
- {
- "in": "path",
- "name": "Id1",
- "description": "key: Id of DocumentDto",
- "required": true,
- "type": "integer",
- "format": "int32",
- "maximum": 2147483647,
- "minimum": -2147483648,
- "x-ms-docs-key-type": "DocumentDto"
- },
- {
- "in": "query",
- "name": "$select",
- "description": "Select properties to be returned",
- "type": "array",
- "items": {
- "enum": [
- "Id",
- "Name",
- "Description",
- "Filename",
- "NumberOfRevisions",
- "Suffix",
- "DomainId",
- "ModificationDate",
- "ModifiedBy",
- "Tags",
- "Revisions"
- ],
- "type": "string"
- }
- },
- {
- "in": "query",
- "name": "$expand",
- "description": "Expand related entities",
- "type": "array",
- "items": {
- "enum": [
- "*",
- "Revisions"
- ],
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Retrieved navigation property",
- "schema": {
- "$ref": "#/definitions/Siterra.Documents.App.DTO.DocumentDto"
- }
- },
- "default": {
- "$ref": "#/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
- }
- },
"/Libraries({Id})/Documents/$ref": {
"get": {
"tags": [
@@ -1707,7 +1496,10 @@
"description": "New navigation property ref value",
"required": true,
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
],
@@ -1715,7 +1507,7 @@
"201": {
"description": "Created navigation property link.",
"schema": {
- "type": "String"
+ "type": "object"
}
},
"default": {
@@ -1723,47 +1515,6 @@
}
},
"x-ms-docs-operation-type": "operation"
- },
- "delete": {
- "tags": [
- "Libraries.DocumentDto"
- ],
- "summary": "Delete ref of navigation property Documents for Libraries",
- "operationId": "Libraries.DeleteRefDocuments",
- "parameters": [
- {
- "in": "path",
- "name": "Id",
- "description": "key: Id of LibraryDto",
- "required": true,
- "type": "integer",
- "format": "int32",
- "maximum": 2147483647,
- "minimum": -2147483648,
- "x-ms-docs-key-type": "LibraryDto"
- },
- {
- "in": "header",
- "name": "If-Match",
- "description": "ETag",
- "type": "string"
- },
- {
- "in": "query",
- "name": "@id",
- "description": "Delete Uri",
- "type": "string"
- }
- ],
- "responses": {
- "204": {
- "description": "Success"
- },
- "default": {
- "$ref": "#/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
}
},
"/Revisions": {
@@ -2245,7 +1996,7 @@
},
"x-ms-docs-operation-type": "operation"
},
- "patch": {
+ "put": {
"tags": [
"Revisions.Document"
],
@@ -2272,7 +2023,10 @@
"description": "New navigation property ref values",
"required": true,
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
],
@@ -2806,96 +2560,6 @@
"x-ms-docs-operation-type": "operation"
}
},
- "/Tasks({Id})/Revisions({Id1})": {
- "get": {
- "tags": [
- "Tasks.RevisionDto"
- ],
- "summary": "Get Revisions from Tasks",
- "operationId": "Tasks.GetRevisions",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "Id",
- "description": "key: Id of DocumentDto",
- "required": true,
- "type": "integer",
- "format": "int32",
- "maximum": 2147483647,
- "minimum": -2147483648,
- "x-ms-docs-key-type": "DocumentDto"
- },
- {
- "in": "path",
- "name": "Id1",
- "description": "key: Id of RevisionDto",
- "required": true,
- "type": "integer",
- "format": "int32",
- "maximum": 2147483647,
- "minimum": -2147483648,
- "x-ms-docs-key-type": "RevisionDto"
- },
- {
- "in": "query",
- "name": "$select",
- "description": "Select properties to be returned",
- "type": "array",
- "items": {
- "enum": [
- "Id",
- "Number",
- "DocumentId",
- "DocumentName",
- "DocumentDescription",
- "CreationDate",
- "CreatedBy",
- "IsReviewed",
- "ReviewedBy",
- "ReviewedDate",
- "IsApproved",
- "ApprovedBy",
- "ApprovedDate",
- "IsRejected",
- "RejectedBy",
- "RejectedDate",
- "DomainId",
- "Document"
- ],
- "type": "string"
- }
- },
- {
- "in": "query",
- "name": "$expand",
- "description": "Expand related entities",
- "type": "array",
- "items": {
- "enum": [
- "*",
- "Document"
- ],
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Retrieved navigation property",
- "schema": {
- "$ref": "#/definitions/Siterra.Documents.App.DTO.RevisionDto"
- }
- },
- "default": {
- "$ref": "#/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
- }
- },
"/Tasks({Id})/Revisions/$ref": {
"get": {
"tags": [
@@ -3031,7 +2695,10 @@
"description": "New navigation property ref value",
"required": true,
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
],
@@ -3039,7 +2706,7 @@
"201": {
"description": "Created navigation property link.",
"schema": {
- "type": "String"
+ "type": "object"
}
},
"default": {
@@ -3047,47 +2714,6 @@
}
},
"x-ms-docs-operation-type": "operation"
- },
- "delete": {
- "tags": [
- "Tasks.RevisionDto"
- ],
- "summary": "Delete ref of navigation property Revisions for Tasks",
- "operationId": "Tasks.DeleteRefRevisions",
- "parameters": [
- {
- "in": "path",
- "name": "Id",
- "description": "key: Id of DocumentDto",
- "required": true,
- "type": "integer",
- "format": "int32",
- "maximum": 2147483647,
- "minimum": -2147483648,
- "x-ms-docs-key-type": "DocumentDto"
- },
- {
- "in": "header",
- "name": "If-Match",
- "description": "ETag",
- "type": "string"
- },
- {
- "in": "query",
- "name": "@id",
- "description": "Delete Uri",
- "type": "string"
- }
- ],
- "responses": {
- "204": {
- "description": "Success"
- },
- "default": {
- "$ref": "#/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
}
}
},
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml
index 19f76f4d..4397f1f3 100644
--- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml
@@ -549,75 +549,6 @@ paths:
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
- '/Documents({Id})/Revisions({Id1})':
- get:
- tags:
- - Documents.RevisionDto
- summary: Get Revisions from Documents
- operationId: Documents.GetRevisions
- produces:
- - application/json
- parameters:
- - in: path
- name: Id
- description: 'key: Id of DocumentDto'
- required: true
- type: integer
- format: int32
- maximum: 2147483647
- minimum: -2147483648
- x-ms-docs-key-type: DocumentDto
- - in: path
- name: Id1
- description: 'key: Id of RevisionDto'
- required: true
- type: integer
- format: int32
- maximum: 2147483647
- minimum: -2147483648
- x-ms-docs-key-type: RevisionDto
- - in: query
- name: $select
- description: Select properties to be returned
- type: array
- items:
- enum:
- - Id
- - Number
- - DocumentId
- - DocumentName
- - DocumentDescription
- - CreationDate
- - CreatedBy
- - IsReviewed
- - ReviewedBy
- - ReviewedDate
- - IsApproved
- - ApprovedBy
- - ApprovedDate
- - IsRejected
- - RejectedBy
- - RejectedDate
- - DomainId
- - Document
- type: string
- - in: query
- name: $expand
- description: Expand related entities
- type: array
- items:
- enum:
- - '*'
- - Document
- type: string
- responses:
- '200':
- description: Retrieved navigation property
- schema:
- $ref: '#/definitions/Siterra.Documents.App.DTO.RevisionDto'
- default:
- $ref: '#/responses/error'
- x-ms-docs-operation-type: operation
'/Documents({Id})/Revisions/$ref':
get:
tags:
@@ -720,41 +651,14 @@ paths:
description: New navigation property ref value
required: true
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
responses:
'201':
description: Created navigation property link.
schema:
- type: String
- default:
- $ref: '#/responses/error'
- x-ms-docs-operation-type: operation
- delete:
- tags:
- - Documents.RevisionDto
- summary: Delete ref of navigation property Revisions for Documents
- operationId: Documents.DeleteRefRevisions
- parameters:
- - in: path
- name: Id
- description: 'key: Id of DocumentDto'
- required: true
- type: integer
- format: int32
- maximum: 2147483647
- minimum: -2147483648
- x-ms-docs-key-type: DocumentDto
- - in: header
- name: If-Match
- description: ETag
- type: string
- - in: query
- name: '@id'
- description: Delete Uri
- type: string
- responses:
- '204':
- description: Success
+ type: object
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
@@ -1081,68 +985,6 @@ paths:
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
- '/Libraries({Id})/Documents({Id1})':
- get:
- tags:
- - Libraries.DocumentDto
- summary: Get Documents from Libraries
- operationId: Libraries.GetDocuments
- produces:
- - application/json
- parameters:
- - in: path
- name: Id
- description: 'key: Id of LibraryDto'
- required: true
- type: integer
- format: int32
- maximum: 2147483647
- minimum: -2147483648
- x-ms-docs-key-type: LibraryDto
- - in: path
- name: Id1
- description: 'key: Id of DocumentDto'
- required: true
- type: integer
- format: int32
- maximum: 2147483647
- minimum: -2147483648
- x-ms-docs-key-type: DocumentDto
- - in: query
- name: $select
- description: Select properties to be returned
- type: array
- items:
- enum:
- - Id
- - Name
- - Description
- - Filename
- - NumberOfRevisions
- - Suffix
- - DomainId
- - ModificationDate
- - ModifiedBy
- - Tags
- - Revisions
- type: string
- - in: query
- name: $expand
- description: Expand related entities
- type: array
- items:
- enum:
- - '*'
- - Revisions
- type: string
- responses:
- '200':
- description: Retrieved navigation property
- schema:
- $ref: '#/definitions/Siterra.Documents.App.DTO.DocumentDto'
- default:
- $ref: '#/responses/error'
- x-ms-docs-operation-type: operation
'/Libraries({Id})/Documents/$ref':
get:
tags:
@@ -1231,41 +1073,14 @@ paths:
description: New navigation property ref value
required: true
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
responses:
'201':
description: Created navigation property link.
schema:
- type: String
- default:
- $ref: '#/responses/error'
- x-ms-docs-operation-type: operation
- delete:
- tags:
- - Libraries.DocumentDto
- summary: Delete ref of navigation property Documents for Libraries
- operationId: Libraries.DeleteRefDocuments
- parameters:
- - in: path
- name: Id
- description: 'key: Id of LibraryDto'
- required: true
- type: integer
- format: int32
- maximum: 2147483647
- minimum: -2147483648
- x-ms-docs-key-type: LibraryDto
- - in: header
- name: If-Match
- description: ETag
- type: string
- - in: query
- name: '@id'
- description: Delete Uri
- type: string
- responses:
- '204':
- description: Success
+ type: object
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
@@ -1632,7 +1447,7 @@ paths:
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
- patch:
+ put:
tags:
- Revisions.Document
summary: Update the ref of navigation property Document in Revisions
@@ -1654,7 +1469,9 @@ paths:
description: New navigation property ref values
required: true
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
responses:
'204':
description: Success
@@ -2036,75 +1853,6 @@ paths:
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
- '/Tasks({Id})/Revisions({Id1})':
- get:
- tags:
- - Tasks.RevisionDto
- summary: Get Revisions from Tasks
- operationId: Tasks.GetRevisions
- produces:
- - application/json
- parameters:
- - in: path
- name: Id
- description: 'key: Id of DocumentDto'
- required: true
- type: integer
- format: int32
- maximum: 2147483647
- minimum: -2147483648
- x-ms-docs-key-type: DocumentDto
- - in: path
- name: Id1
- description: 'key: Id of RevisionDto'
- required: true
- type: integer
- format: int32
- maximum: 2147483647
- minimum: -2147483648
- x-ms-docs-key-type: RevisionDto
- - in: query
- name: $select
- description: Select properties to be returned
- type: array
- items:
- enum:
- - Id
- - Number
- - DocumentId
- - DocumentName
- - DocumentDescription
- - CreationDate
- - CreatedBy
- - IsReviewed
- - ReviewedBy
- - ReviewedDate
- - IsApproved
- - ApprovedBy
- - ApprovedDate
- - IsRejected
- - RejectedBy
- - RejectedDate
- - DomainId
- - Document
- type: string
- - in: query
- name: $expand
- description: Expand related entities
- type: array
- items:
- enum:
- - '*'
- - Document
- type: string
- responses:
- '200':
- description: Retrieved navigation property
- schema:
- $ref: '#/definitions/Siterra.Documents.App.DTO.RevisionDto'
- default:
- $ref: '#/responses/error'
- x-ms-docs-operation-type: operation
'/Tasks({Id})/Revisions/$ref':
get:
tags:
@@ -2207,41 +1955,14 @@ paths:
description: New navigation property ref value
required: true
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
responses:
'201':
description: Created navigation property link.
schema:
- type: String
- default:
- $ref: '#/responses/error'
- x-ms-docs-operation-type: operation
- delete:
- tags:
- - Tasks.RevisionDto
- summary: Delete ref of navigation property Revisions for Tasks
- operationId: Tasks.DeleteRefRevisions
- parameters:
- - in: path
- name: Id
- description: 'key: Id of DocumentDto'
- required: true
- type: integer
- format: int32
- maximum: 2147483647
- minimum: -2147483648
- x-ms-docs-key-type: DocumentDto
- - in: header
- name: If-Match
- description: ETag
- type: string
- - in: query
- name: '@id'
- description: Delete Uri
- type: string
- responses:
- '204':
- description: Success
+ type: object
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json
index 2d9ce89a..6381aa23 100644
--- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json
@@ -867,120 +867,6 @@
"x-ms-docs-operation-type": "operation"
}
},
- "/Documents({Id})/Revisions({Id1})": {
- "get": {
- "tags": [
- "Documents.RevisionDto"
- ],
- "summary": "Get Revisions from Documents",
- "operationId": "Documents.GetRevisions",
- "parameters": [
- {
- "name": "Id",
- "in": "path",
- "description": "key: Id of DocumentDto",
- "required": true,
- "schema": {
- "maximum": 2147483647,
- "minimum": -2147483648,
- "type": "integer",
- "format": "int32"
- },
- "x-ms-docs-key-type": "DocumentDto"
- },
- {
- "name": "Id1",
- "in": "path",
- "description": "key: Id of RevisionDto",
- "required": true,
- "schema": {
- "maximum": 2147483647,
- "minimum": -2147483648,
- "type": "integer",
- "format": "int32"
- },
- "x-ms-docs-key-type": "RevisionDto"
- },
- {
- "name": "$select",
- "in": "query",
- "description": "Select properties to be returned",
- "style": "form",
- "explode": false,
- "schema": {
- "uniqueItems": true,
- "type": "array",
- "items": {
- "enum": [
- "Id",
- "Number",
- "DocumentId",
- "DocumentName",
- "DocumentDescription",
- "CreationDate",
- "CreatedBy",
- "IsReviewed",
- "ReviewedBy",
- "ReviewedDate",
- "IsApproved",
- "ApprovedBy",
- "ApprovedDate",
- "IsRejected",
- "RejectedBy",
- "RejectedDate",
- "DomainId",
- "Document"
- ],
- "type": "string"
- }
- }
- },
- {
- "name": "$expand",
- "in": "query",
- "description": "Expand related entities",
- "style": "form",
- "explode": false,
- "schema": {
- "uniqueItems": true,
- "type": "array",
- "items": {
- "enum": [
- "*",
- "Document"
- ],
- "type": "string"
- }
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Retrieved navigation property",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Siterra.Documents.App.DTO.RevisionDto"
- }
- }
- },
- "links": {
- "Document": {
- "operationId": "Documents.Revisions.GetDocument",
- "parameters": {
- "Id": "$request.path.Id",
- "Id1": "$request.path.Id1"
- }
- }
- }
- },
- "default": {
- "$ref": "#/components/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
- }
- },
"/Documents({Id})/Revisions/$ref": {
"get": {
"tags": [
@@ -1120,7 +1006,10 @@
"content": {
"application/json": {
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
},
@@ -1132,7 +1021,7 @@
"content": {
"application/json": {
"schema": {
- "type": "String"
+ "type": "object"
}
}
}
@@ -1142,53 +1031,6 @@
}
},
"x-ms-docs-operation-type": "operation"
- },
- "delete": {
- "tags": [
- "Documents.RevisionDto"
- ],
- "summary": "Delete ref of navigation property Revisions for Documents",
- "operationId": "Documents.DeleteRefRevisions",
- "parameters": [
- {
- "name": "Id",
- "in": "path",
- "description": "key: Id of DocumentDto",
- "required": true,
- "schema": {
- "maximum": 2147483647,
- "minimum": -2147483648,
- "type": "integer",
- "format": "int32"
- },
- "x-ms-docs-key-type": "DocumentDto"
- },
- {
- "name": "If-Match",
- "in": "header",
- "description": "ETag",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "@id",
- "in": "query",
- "description": "Delete Uri",
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "204": {
- "description": "Success"
- },
- "default": {
- "$ref": "#/components/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
}
},
"/Libraries": {
@@ -1695,113 +1537,6 @@
"x-ms-docs-operation-type": "operation"
}
},
- "/Libraries({Id})/Documents({Id1})": {
- "get": {
- "tags": [
- "Libraries.DocumentDto"
- ],
- "summary": "Get Documents from Libraries",
- "operationId": "Libraries.GetDocuments",
- "parameters": [
- {
- "name": "Id",
- "in": "path",
- "description": "key: Id of LibraryDto",
- "required": true,
- "schema": {
- "maximum": 2147483647,
- "minimum": -2147483648,
- "type": "integer",
- "format": "int32"
- },
- "x-ms-docs-key-type": "LibraryDto"
- },
- {
- "name": "Id1",
- "in": "path",
- "description": "key: Id of DocumentDto",
- "required": true,
- "schema": {
- "maximum": 2147483647,
- "minimum": -2147483648,
- "type": "integer",
- "format": "int32"
- },
- "x-ms-docs-key-type": "DocumentDto"
- },
- {
- "name": "$select",
- "in": "query",
- "description": "Select properties to be returned",
- "style": "form",
- "explode": false,
- "schema": {
- "uniqueItems": true,
- "type": "array",
- "items": {
- "enum": [
- "Id",
- "Name",
- "Description",
- "Filename",
- "NumberOfRevisions",
- "Suffix",
- "DomainId",
- "ModificationDate",
- "ModifiedBy",
- "Tags",
- "Revisions"
- ],
- "type": "string"
- }
- }
- },
- {
- "name": "$expand",
- "in": "query",
- "description": "Expand related entities",
- "style": "form",
- "explode": false,
- "schema": {
- "uniqueItems": true,
- "type": "array",
- "items": {
- "enum": [
- "*",
- "Revisions"
- ],
- "type": "string"
- }
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Retrieved navigation property",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Siterra.Documents.App.DTO.DocumentDto"
- }
- }
- },
- "links": {
- "Revisions": {
- "operationId": "Libraries.Documents.ListRevisions",
- "parameters": {
- "Id": "$request.path.Id",
- "Id1": "$request.path.Id1"
- }
- }
- }
- },
- "default": {
- "$ref": "#/components/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
- }
- },
"/Libraries({Id})/Documents/$ref": {
"get": {
"tags": [
@@ -1927,7 +1662,10 @@
"content": {
"application/json": {
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
},
@@ -1939,7 +1677,7 @@
"content": {
"application/json": {
"schema": {
- "type": "String"
+ "type": "object"
}
}
}
@@ -1949,53 +1687,6 @@
}
},
"x-ms-docs-operation-type": "operation"
- },
- "delete": {
- "tags": [
- "Libraries.DocumentDto"
- ],
- "summary": "Delete ref of navigation property Documents for Libraries",
- "operationId": "Libraries.DeleteRefDocuments",
- "parameters": [
- {
- "name": "Id",
- "in": "path",
- "description": "key: Id of LibraryDto",
- "required": true,
- "schema": {
- "maximum": 2147483647,
- "minimum": -2147483648,
- "type": "integer",
- "format": "int32"
- },
- "x-ms-docs-key-type": "LibraryDto"
- },
- {
- "name": "If-Match",
- "in": "header",
- "description": "ETag",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "@id",
- "in": "query",
- "description": "Delete Uri",
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "204": {
- "description": "Success"
- },
- "default": {
- "$ref": "#/components/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
}
},
"/Revisions": {
@@ -2597,7 +2288,7 @@
},
"x-ms-docs-operation-type": "operation"
},
- "patch": {
+ "put": {
"tags": [
"Revisions.Document"
],
@@ -2623,7 +2314,10 @@
"content": {
"application/json": {
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
},
@@ -3224,120 +2918,6 @@
"x-ms-docs-operation-type": "operation"
}
},
- "/Tasks({Id})/Revisions({Id1})": {
- "get": {
- "tags": [
- "Tasks.RevisionDto"
- ],
- "summary": "Get Revisions from Tasks",
- "operationId": "Tasks.GetRevisions",
- "parameters": [
- {
- "name": "Id",
- "in": "path",
- "description": "key: Id of DocumentDto",
- "required": true,
- "schema": {
- "maximum": 2147483647,
- "minimum": -2147483648,
- "type": "integer",
- "format": "int32"
- },
- "x-ms-docs-key-type": "DocumentDto"
- },
- {
- "name": "Id1",
- "in": "path",
- "description": "key: Id of RevisionDto",
- "required": true,
- "schema": {
- "maximum": 2147483647,
- "minimum": -2147483648,
- "type": "integer",
- "format": "int32"
- },
- "x-ms-docs-key-type": "RevisionDto"
- },
- {
- "name": "$select",
- "in": "query",
- "description": "Select properties to be returned",
- "style": "form",
- "explode": false,
- "schema": {
- "uniqueItems": true,
- "type": "array",
- "items": {
- "enum": [
- "Id",
- "Number",
- "DocumentId",
- "DocumentName",
- "DocumentDescription",
- "CreationDate",
- "CreatedBy",
- "IsReviewed",
- "ReviewedBy",
- "ReviewedDate",
- "IsApproved",
- "ApprovedBy",
- "ApprovedDate",
- "IsRejected",
- "RejectedBy",
- "RejectedDate",
- "DomainId",
- "Document"
- ],
- "type": "string"
- }
- }
- },
- {
- "name": "$expand",
- "in": "query",
- "description": "Expand related entities",
- "style": "form",
- "explode": false,
- "schema": {
- "uniqueItems": true,
- "type": "array",
- "items": {
- "enum": [
- "*",
- "Document"
- ],
- "type": "string"
- }
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Retrieved navigation property",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Siterra.Documents.App.DTO.RevisionDto"
- }
- }
- },
- "links": {
- "Document": {
- "operationId": "Tasks.Revisions.GetDocument",
- "parameters": {
- "Id": "$request.path.Id",
- "Id1": "$request.path.Id1"
- }
- }
- }
- },
- "default": {
- "$ref": "#/components/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
- }
- },
"/Tasks({Id})/Revisions/$ref": {
"get": {
"tags": [
@@ -3477,7 +3057,10 @@
"content": {
"application/json": {
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
},
@@ -3489,7 +3072,7 @@
"content": {
"application/json": {
"schema": {
- "type": "String"
+ "type": "object"
}
}
}
@@ -3499,53 +3082,6 @@
}
},
"x-ms-docs-operation-type": "operation"
- },
- "delete": {
- "tags": [
- "Tasks.RevisionDto"
- ],
- "summary": "Delete ref of navigation property Revisions for Tasks",
- "operationId": "Tasks.DeleteRefRevisions",
- "parameters": [
- {
- "name": "Id",
- "in": "path",
- "description": "key: Id of DocumentDto",
- "required": true,
- "schema": {
- "maximum": 2147483647,
- "minimum": -2147483648,
- "type": "integer",
- "format": "int32"
- },
- "x-ms-docs-key-type": "DocumentDto"
- },
- {
- "name": "If-Match",
- "in": "header",
- "description": "ETag",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "@id",
- "in": "query",
- "description": "Delete Uri",
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "204": {
- "description": "Success"
- },
- "default": {
- "$ref": "#/components/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
}
}
},
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml
index 47d8e433..8fa81a80 100644
--- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml
@@ -609,91 +609,6 @@ paths:
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
- '/Documents({Id})/Revisions({Id1})':
- get:
- tags:
- - Documents.RevisionDto
- summary: Get Revisions from Documents
- operationId: Documents.GetRevisions
- parameters:
- - name: Id
- in: path
- description: 'key: Id of DocumentDto'
- required: true
- schema:
- maximum: 2147483647
- minimum: -2147483648
- type: integer
- format: int32
- x-ms-docs-key-type: DocumentDto
- - name: Id1
- in: path
- description: 'key: Id of RevisionDto'
- required: true
- schema:
- maximum: 2147483647
- minimum: -2147483648
- type: integer
- format: int32
- x-ms-docs-key-type: RevisionDto
- - name: $select
- in: query
- description: Select properties to be returned
- style: form
- explode: false
- schema:
- uniqueItems: true
- type: array
- items:
- enum:
- - Id
- - Number
- - DocumentId
- - DocumentName
- - DocumentDescription
- - CreationDate
- - CreatedBy
- - IsReviewed
- - ReviewedBy
- - ReviewedDate
- - IsApproved
- - ApprovedBy
- - ApprovedDate
- - IsRejected
- - RejectedBy
- - RejectedDate
- - DomainId
- - Document
- type: string
- - name: $expand
- in: query
- description: Expand related entities
- style: form
- explode: false
- schema:
- uniqueItems: true
- type: array
- items:
- enum:
- - '*'
- - Document
- type: string
- responses:
- '200':
- description: Retrieved navigation property
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Siterra.Documents.App.DTO.RevisionDto'
- links:
- Document:
- operationId: Documents.Revisions.GetDocument
- parameters:
- Id: $request.path.Id
- Id1: $request.path.Id1
- default:
- $ref: '#/components/responses/error'
- x-ms-docs-operation-type: operation
'/Documents({Id})/Revisions/$ref':
get:
tags:
@@ -798,7 +713,9 @@ paths:
content:
application/json:
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
required: true
responses:
'201':
@@ -806,39 +723,7 @@ paths:
content:
application/json:
schema:
- type: String
- default:
- $ref: '#/components/responses/error'
- x-ms-docs-operation-type: operation
- delete:
- tags:
- - Documents.RevisionDto
- summary: Delete ref of navigation property Revisions for Documents
- operationId: Documents.DeleteRefRevisions
- parameters:
- - name: Id
- in: path
- description: 'key: Id of DocumentDto'
- required: true
- schema:
- maximum: 2147483647
- minimum: -2147483648
- type: integer
- format: int32
- x-ms-docs-key-type: DocumentDto
- - name: If-Match
- in: header
- description: ETag
- schema:
- type: string
- - name: '@id'
- in: query
- description: Delete Uri
- schema:
- type: string
- responses:
- '204':
- description: Success
+ type: object
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
@@ -1204,84 +1089,6 @@ paths:
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
- '/Libraries({Id})/Documents({Id1})':
- get:
- tags:
- - Libraries.DocumentDto
- summary: Get Documents from Libraries
- operationId: Libraries.GetDocuments
- parameters:
- - name: Id
- in: path
- description: 'key: Id of LibraryDto'
- required: true
- schema:
- maximum: 2147483647
- minimum: -2147483648
- type: integer
- format: int32
- x-ms-docs-key-type: LibraryDto
- - name: Id1
- in: path
- description: 'key: Id of DocumentDto'
- required: true
- schema:
- maximum: 2147483647
- minimum: -2147483648
- type: integer
- format: int32
- x-ms-docs-key-type: DocumentDto
- - name: $select
- in: query
- description: Select properties to be returned
- style: form
- explode: false
- schema:
- uniqueItems: true
- type: array
- items:
- enum:
- - Id
- - Name
- - Description
- - Filename
- - NumberOfRevisions
- - Suffix
- - DomainId
- - ModificationDate
- - ModifiedBy
- - Tags
- - Revisions
- type: string
- - name: $expand
- in: query
- description: Expand related entities
- style: form
- explode: false
- schema:
- uniqueItems: true
- type: array
- items:
- enum:
- - '*'
- - Revisions
- type: string
- responses:
- '200':
- description: Retrieved navigation property
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentDto'
- links:
- Revisions:
- operationId: Libraries.Documents.ListRevisions
- parameters:
- Id: $request.path.Id
- Id1: $request.path.Id1
- default:
- $ref: '#/components/responses/error'
- x-ms-docs-operation-type: operation
'/Libraries({Id})/Documents/$ref':
get:
tags:
@@ -1372,7 +1179,9 @@ paths:
content:
application/json:
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
required: true
responses:
'201':
@@ -1380,39 +1189,7 @@ paths:
content:
application/json:
schema:
- type: String
- default:
- $ref: '#/components/responses/error'
- x-ms-docs-operation-type: operation
- delete:
- tags:
- - Libraries.DocumentDto
- summary: Delete ref of navigation property Documents for Libraries
- operationId: Libraries.DeleteRefDocuments
- parameters:
- - name: Id
- in: path
- description: 'key: Id of LibraryDto'
- required: true
- schema:
- maximum: 2147483647
- minimum: -2147483648
- type: integer
- format: int32
- x-ms-docs-key-type: LibraryDto
- - name: If-Match
- in: header
- description: ETag
- schema:
- type: string
- - name: '@id'
- in: query
- description: Delete Uri
- schema:
- type: string
- responses:
- '204':
- description: Success
+ type: object
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
@@ -1857,7 +1634,7 @@ paths:
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
- patch:
+ put:
tags:
- Revisions.Document
summary: Update the ref of navigation property Document in Revisions
@@ -1878,7 +1655,9 @@ paths:
content:
application/json:
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
required: true
responses:
'204':
@@ -2303,91 +2082,6 @@ paths:
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
- '/Tasks({Id})/Revisions({Id1})':
- get:
- tags:
- - Tasks.RevisionDto
- summary: Get Revisions from Tasks
- operationId: Tasks.GetRevisions
- parameters:
- - name: Id
- in: path
- description: 'key: Id of DocumentDto'
- required: true
- schema:
- maximum: 2147483647
- minimum: -2147483648
- type: integer
- format: int32
- x-ms-docs-key-type: DocumentDto
- - name: Id1
- in: path
- description: 'key: Id of RevisionDto'
- required: true
- schema:
- maximum: 2147483647
- minimum: -2147483648
- type: integer
- format: int32
- x-ms-docs-key-type: RevisionDto
- - name: $select
- in: query
- description: Select properties to be returned
- style: form
- explode: false
- schema:
- uniqueItems: true
- type: array
- items:
- enum:
- - Id
- - Number
- - DocumentId
- - DocumentName
- - DocumentDescription
- - CreationDate
- - CreatedBy
- - IsReviewed
- - ReviewedBy
- - ReviewedDate
- - IsApproved
- - ApprovedBy
- - ApprovedDate
- - IsRejected
- - RejectedBy
- - RejectedDate
- - DomainId
- - Document
- type: string
- - name: $expand
- in: query
- description: Expand related entities
- style: form
- explode: false
- schema:
- uniqueItems: true
- type: array
- items:
- enum:
- - '*'
- - Document
- type: string
- responses:
- '200':
- description: Retrieved navigation property
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Siterra.Documents.App.DTO.RevisionDto'
- links:
- Document:
- operationId: Tasks.Revisions.GetDocument
- parameters:
- Id: $request.path.Id
- Id1: $request.path.Id1
- default:
- $ref: '#/components/responses/error'
- x-ms-docs-operation-type: operation
'/Tasks({Id})/Revisions/$ref':
get:
tags:
@@ -2492,7 +2186,9 @@ paths:
content:
application/json:
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
required: true
responses:
'201':
@@ -2500,39 +2196,7 @@ paths:
content:
application/json:
schema:
- type: String
- default:
- $ref: '#/components/responses/error'
- x-ms-docs-operation-type: operation
- delete:
- tags:
- - Tasks.RevisionDto
- summary: Delete ref of navigation property Revisions for Tasks
- operationId: Tasks.DeleteRefRevisions
- parameters:
- - name: Id
- in: path
- description: 'key: Id of DocumentDto'
- required: true
- schema:
- maximum: 2147483647
- minimum: -2147483648
- type: integer
- format: int32
- x-ms-docs-key-type: DocumentDto
- - name: If-Match
- in: header
- description: ETag
- schema:
- type: string
- - name: '@id'
- in: query
- description: Delete Uri
- schema:
- type: string
- responses:
- '204':
- description: Success
+ type: object
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OData.xml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OData.xml
index fc90c82d..adf4ae02 100644
--- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OData.xml
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OData.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json
index 711b8c74..46ef53ec 100644
--- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json
@@ -774,7 +774,7 @@
},
"x-ms-docs-operation-type": "operation"
},
- "patch": {
+ "put": {
"tags": [
"Me.Person"
],
@@ -790,7 +790,10 @@
"description": "New navigation property ref values",
"required": true,
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
],
@@ -952,80 +955,6 @@
"x-ms-docs-operation-type": "operation"
}
},
- "/Me/Friends/{UserName}": {
- "get": {
- "tags": [
- "Me.Person"
- ],
- "summary": "Get Friends from Me",
- "operationId": "Me.GetFriends",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "UserName",
- "description": "key: UserName of Person",
- "required": true,
- "type": "string",
- "x-ms-docs-key-type": "Person"
- },
- {
- "in": "query",
- "name": "$select",
- "description": "Select properties to be returned",
- "type": "array",
- "items": {
- "enum": [
- "UserName",
- "FirstName",
- "LastName",
- "MiddleName",
- "Gender",
- "Age",
- "Emails",
- "AddressInfo",
- "HomeAddress",
- "FavoriteFeature",
- "Features",
- "Friends",
- "BestFriend",
- "Trips"
- ],
- "type": "string"
- }
- },
- {
- "in": "query",
- "name": "$expand",
- "description": "Expand related entities",
- "type": "array",
- "items": {
- "enum": [
- "*",
- "Friends",
- "BestFriend",
- "Trips"
- ],
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Retrieved navigation property",
- "schema": {
- "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
- }
- },
- "default": {
- "$ref": "#/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
- }
- },
"/Me/Friends/$ref": {
"get": {
"tags": [
@@ -1127,7 +1056,10 @@
"description": "New navigation property ref value",
"required": true,
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
],
@@ -1135,7 +1067,7 @@
"201": {
"description": "Created navigation property link.",
"schema": {
- "type": "String"
+ "type": "object"
}
},
"default": {
@@ -1143,36 +1075,6 @@
}
},
"x-ms-docs-operation-type": "operation"
- },
- "delete": {
- "tags": [
- "Me.Person"
- ],
- "summary": "Delete ref of navigation property Friends for Me",
- "operationId": "Me.DeleteRefFriends",
- "parameters": [
- {
- "in": "header",
- "name": "If-Match",
- "description": "ETag",
- "type": "string"
- },
- {
- "in": "query",
- "name": "@id",
- "description": "Delete Uri",
- "type": "string"
- }
- ],
- "responses": {
- "204": {
- "description": "Success"
- },
- "default": {
- "$ref": "#/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
}
},
"/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": {
@@ -1470,6 +1372,42 @@
}
},
"x-ms-docs-operation-type": "operation"
+ },
+ "post": {
+ "tags": [
+ "Me.Trip"
+ ],
+ "summary": "Create new navigation property to Trips for Me",
+ "operationId": "Me.CreateTrips",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "body",
+ "name": "body",
+ "description": "New navigation property",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ }
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Created navigation property.",
+ "schema": {
+ "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ }
+ },
+ "default": {
+ "$ref": "#/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "operation"
}
},
"/Me/Trips/{TripId}": {
@@ -1540,6 +1478,82 @@
}
},
"x-ms-docs-operation-type": "operation"
+ },
+ "patch": {
+ "tags": [
+ "Me.Trip"
+ ],
+ "summary": "Update the navigation property Trips in Me",
+ "operationId": "Me.UpdateTrips",
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "TripId",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "type": "integer",
+ "format": "int32",
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "x-ms-docs-key-type": "Trip"
+ },
+ {
+ "in": "body",
+ "name": "body",
+ "description": "New navigation property values",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Success"
+ },
+ "default": {
+ "$ref": "#/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "operation"
+ },
+ "delete": {
+ "tags": [
+ "Me.Trip"
+ ],
+ "summary": "Delete navigation property Trips for Me",
+ "operationId": "Me.DeleteTrips",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "TripId",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "type": "integer",
+ "format": "int32",
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "x-ms-docs-key-type": "Trip"
+ },
+ {
+ "in": "header",
+ "name": "If-Match",
+ "description": "ETag",
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Success"
+ },
+ "default": {
+ "$ref": "#/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "operation"
}
},
"/Me/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": {
@@ -1582,17 +1596,28 @@
"x-ms-docs-operation-type": "function"
}
},
- "/Me/Trips/$ref": {
+ "/Me/Trips/{TripId}/PlanItems": {
"get": {
"tags": [
- "Me.Trip"
+ "Me.Trips.PlanItem"
],
- "summary": "Get ref of Trips from Me",
- "operationId": "Me.ListRefTrips",
+ "summary": "Get PlanItems from Me",
+ "operationId": "Me.Trips.ListPlanItems",
"produces": [
"application/json"
],
"parameters": [
+ {
+ "in": "path",
+ "name": "TripId",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "type": "integer",
+ "format": "int32",
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "x-ms-docs-key-type": "Trip"
+ },
{
"$ref": "#/parameters/top"
},
@@ -1615,22 +1640,44 @@
"type": "array",
"items": {
"enum": [
- "TripId",
- "TripId desc",
- "ShareId",
- "ShareId desc",
- "Name",
- "Name desc",
- "Budget",
- "Budget desc",
- "Description",
- "Description desc",
- "Tags",
- "Tags desc",
+ "PlanItemId",
+ "PlanItemId desc",
+ "ConfirmationCode",
+ "ConfirmationCode desc",
"StartsAt",
"StartsAt desc",
"EndsAt",
- "EndsAt desc"
+ "EndsAt desc",
+ "Duration",
+ "Duration desc"
+ ],
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "$select",
+ "description": "Select properties to be returned",
+ "type": "array",
+ "items": {
+ "enum": [
+ "PlanItemId",
+ "ConfirmationCode",
+ "StartsAt",
+ "EndsAt",
+ "Duration"
+ ],
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "$expand",
+ "description": "Expand related entities",
+ "type": "array",
+ "items": {
+ "enum": [
+ "*"
],
"type": "string"
}
@@ -1638,15 +1685,15 @@
],
"responses": {
"200": {
- "description": "Retrieved navigation property links",
+ "description": "Retrieved navigation property",
"schema": {
- "title": "Collection of links of Trip",
+ "title": "Collection of PlanItem",
"type": "object",
"properties": {
"value": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem"
}
}
}
@@ -1657,35 +1704,81 @@
}
},
"x-ms-docs-operation-type": "operation"
- },
- "post": {
+ }
+ },
+ "/Me/Trips/{TripId}/PlanItems/$ref": {
+ "get": {
"tags": [
- "Me.Trip"
- ],
- "summary": "Create new navigation property ref to Trips for Me",
- "operationId": "Me.CreateRefTrips",
- "consumes": [
- "application/json"
+ "Me.Trips.PlanItem"
],
+ "summary": "Get ref of PlanItems from Me",
+ "operationId": "Me.Trips.ListRefPlanItems",
"produces": [
"application/json"
],
"parameters": [
{
- "in": "body",
- "name": "body",
- "description": "New navigation property ref value",
+ "in": "path",
+ "name": "TripId",
+ "description": "key: TripId of Trip",
"required": true,
- "schema": {
- "type": "String"
+ "type": "integer",
+ "format": "int32",
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "x-ms-docs-key-type": "Trip"
+ },
+ {
+ "$ref": "#/parameters/top"
+ },
+ {
+ "$ref": "#/parameters/skip"
+ },
+ {
+ "$ref": "#/parameters/search"
+ },
+ {
+ "$ref": "#/parameters/filter"
+ },
+ {
+ "$ref": "#/parameters/count"
+ },
+ {
+ "in": "query",
+ "name": "$orderby",
+ "description": "Order items by property values",
+ "type": "array",
+ "items": {
+ "enum": [
+ "PlanItemId",
+ "PlanItemId desc",
+ "ConfirmationCode",
+ "ConfirmationCode desc",
+ "StartsAt",
+ "StartsAt desc",
+ "EndsAt",
+ "EndsAt desc",
+ "Duration",
+ "Duration desc"
+ ],
+ "type": "string"
}
}
],
"responses": {
- "201": {
- "description": "Created navigation property link.",
+ "200": {
+ "description": "Retrieved navigation property links",
"schema": {
- "type": "String"
+ "title": "Collection of links of PlanItem",
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
}
},
"default": {
@@ -1694,29 +1787,49 @@
},
"x-ms-docs-operation-type": "operation"
},
- "delete": {
+ "post": {
"tags": [
- "Me.Trip"
+ "Me.Trips.PlanItem"
+ ],
+ "summary": "Create new navigation property ref to PlanItems for Me",
+ "operationId": "Me.Trips.CreateRefPlanItems",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
],
- "summary": "Delete ref of navigation property Trips for Me",
- "operationId": "Me.DeleteRefTrips",
"parameters": [
{
- "in": "header",
- "name": "If-Match",
- "description": "ETag",
- "type": "string"
+ "in": "path",
+ "name": "TripId",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "type": "integer",
+ "format": "int32",
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "x-ms-docs-key-type": "Trip"
},
{
- "in": "query",
- "name": "@id",
- "description": "Delete Uri",
- "type": "string"
+ "in": "body",
+ "name": "body",
+ "description": "New navigation property ref value",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
+ }
}
],
"responses": {
- "204": {
- "description": "Success"
+ "201": {
+ "description": "Created navigation property link.",
+ "schema": {
+ "type": "object"
+ }
},
"default": {
"$ref": "#/responses/error"
@@ -2134,7 +2247,7 @@
},
"x-ms-docs-operation-type": "operation"
},
- "patch": {
+ "put": {
"tags": [
"NewComePeople.Person"
],
@@ -2158,7 +2271,10 @@
"description": "New navigation property ref values",
"required": true,
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
],
@@ -2336,88 +2452,6 @@
"x-ms-docs-operation-type": "operation"
}
},
- "/NewComePeople/{UserName}/Friends/{UserName1}": {
- "get": {
- "tags": [
- "NewComePeople.Person"
- ],
- "summary": "Get Friends from NewComePeople",
- "operationId": "NewComePeople.GetFriends",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "UserName",
- "description": "key: UserName of Person",
- "required": true,
- "type": "string",
- "x-ms-docs-key-type": "Person"
- },
- {
- "in": "path",
- "name": "UserName1",
- "description": "key: UserName of Person",
- "required": true,
- "type": "string",
- "x-ms-docs-key-type": "Person"
- },
- {
- "in": "query",
- "name": "$select",
- "description": "Select properties to be returned",
- "type": "array",
- "items": {
- "enum": [
- "UserName",
- "FirstName",
- "LastName",
- "MiddleName",
- "Gender",
- "Age",
- "Emails",
- "AddressInfo",
- "HomeAddress",
- "FavoriteFeature",
- "Features",
- "Friends",
- "BestFriend",
- "Trips"
- ],
- "type": "string"
- }
- },
- {
- "in": "query",
- "name": "$expand",
- "description": "Expand related entities",
- "type": "array",
- "items": {
- "enum": [
- "*",
- "Friends",
- "BestFriend",
- "Trips"
- ],
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Retrieved navigation property",
- "schema": {
- "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
- }
- },
- "default": {
- "$ref": "#/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
- }
- },
"/NewComePeople/{UserName}/Friends/$ref": {
"get": {
"tags": [
@@ -2535,7 +2569,10 @@
"description": "New navigation property ref value",
"required": true,
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
],
@@ -2543,7 +2580,7 @@
"201": {
"description": "Created navigation property link.",
"schema": {
- "type": "String"
+ "type": "object"
}
},
"default": {
@@ -2551,44 +2588,6 @@
}
},
"x-ms-docs-operation-type": "operation"
- },
- "delete": {
- "tags": [
- "NewComePeople.Person"
- ],
- "summary": "Delete ref of navigation property Friends for NewComePeople",
- "operationId": "NewComePeople.DeleteRefFriends",
- "parameters": [
- {
- "in": "path",
- "name": "UserName",
- "description": "key: UserName of Person",
- "required": true,
- "type": "string",
- "x-ms-docs-key-type": "Person"
- },
- {
- "in": "header",
- "name": "If-Match",
- "description": "ETag",
- "type": "string"
- },
- {
- "in": "query",
- "name": "@id",
- "description": "Delete Uri",
- "type": "string"
- }
- ],
- "responses": {
- "204": {
- "description": "Success"
- },
- "default": {
- "$ref": "#/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
}
},
"/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": {
@@ -2936,15 +2935,16 @@
}
},
"x-ms-docs-operation-type": "operation"
- }
- },
- "/NewComePeople/{UserName}/Trips/{TripId}": {
- "get": {
+ },
+ "post": {
"tags": [
"NewComePeople.Trip"
],
- "summary": "Get Trips from NewComePeople",
- "operationId": "NewComePeople.GetTrips",
+ "summary": "Create new navigation property to Trips for NewComePeople",
+ "operationId": "NewComePeople.CreateTrips",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
@@ -2958,20 +2958,63 @@
"x-ms-docs-key-type": "Person"
},
{
- "in": "path",
- "name": "TripId",
- "description": "key: TripId of Trip",
+ "in": "body",
+ "name": "body",
+ "description": "New navigation property",
"required": true,
- "type": "integer",
- "format": "int32",
- "maximum": 2147483647,
- "minimum": -2147483648,
- "x-ms-docs-key-type": "Trip"
+ "schema": {
+ "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ }
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Created navigation property.",
+ "schema": {
+ "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ }
},
- {
- "in": "query",
- "name": "$select",
- "description": "Select properties to be returned",
+ "default": {
+ "$ref": "#/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "operation"
+ }
+ },
+ "/NewComePeople/{UserName}/Trips/{TripId}": {
+ "get": {
+ "tags": [
+ "NewComePeople.Trip"
+ ],
+ "summary": "Get Trips from NewComePeople",
+ "operationId": "NewComePeople.GetTrips",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "UserName",
+ "description": "key: UserName of Person",
+ "required": true,
+ "type": "string",
+ "x-ms-docs-key-type": "Person"
+ },
+ {
+ "in": "path",
+ "name": "TripId",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "type": "integer",
+ "format": "int32",
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "x-ms-docs-key-type": "Trip"
+ },
+ {
+ "in": "query",
+ "name": "$select",
+ "description": "Select properties to be returned",
"type": "array",
"items": {
"enum": [
@@ -3014,6 +3057,98 @@
}
},
"x-ms-docs-operation-type": "operation"
+ },
+ "patch": {
+ "tags": [
+ "NewComePeople.Trip"
+ ],
+ "summary": "Update the navigation property Trips in NewComePeople",
+ "operationId": "NewComePeople.UpdateTrips",
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "UserName",
+ "description": "key: UserName of Person",
+ "required": true,
+ "type": "string",
+ "x-ms-docs-key-type": "Person"
+ },
+ {
+ "in": "path",
+ "name": "TripId",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "type": "integer",
+ "format": "int32",
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "x-ms-docs-key-type": "Trip"
+ },
+ {
+ "in": "body",
+ "name": "body",
+ "description": "New navigation property values",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Success"
+ },
+ "default": {
+ "$ref": "#/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "operation"
+ },
+ "delete": {
+ "tags": [
+ "NewComePeople.Trip"
+ ],
+ "summary": "Delete navigation property Trips for NewComePeople",
+ "operationId": "NewComePeople.DeleteTrips",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "UserName",
+ "description": "key: UserName of Person",
+ "required": true,
+ "type": "string",
+ "x-ms-docs-key-type": "Person"
+ },
+ {
+ "in": "path",
+ "name": "TripId",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "type": "integer",
+ "format": "int32",
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "x-ms-docs-key-type": "Trip"
+ },
+ {
+ "in": "header",
+ "name": "If-Match",
+ "description": "ETag",
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Success"
+ },
+ "default": {
+ "$ref": "#/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "operation"
}
},
"/NewComePeople/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": {
@@ -3064,13 +3199,13 @@
"x-ms-docs-operation-type": "function"
}
},
- "/NewComePeople/{UserName}/Trips/$ref": {
+ "/NewComePeople/{UserName}/Trips/{TripId}/PlanItems": {
"get": {
"tags": [
- "NewComePeople.Trip"
+ "NewComePeople.Trips.PlanItem"
],
- "summary": "Get ref of Trips from NewComePeople",
- "operationId": "NewComePeople.ListRefTrips",
+ "summary": "Get PlanItems from NewComePeople",
+ "operationId": "NewComePeople.Trips.ListPlanItems",
"produces": [
"application/json"
],
@@ -3083,6 +3218,17 @@
"type": "string",
"x-ms-docs-key-type": "Person"
},
+ {
+ "in": "path",
+ "name": "TripId",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "type": "integer",
+ "format": "int32",
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "x-ms-docs-key-type": "Trip"
+ },
{
"$ref": "#/parameters/top"
},
@@ -3105,22 +3251,44 @@
"type": "array",
"items": {
"enum": [
- "TripId",
- "TripId desc",
- "ShareId",
- "ShareId desc",
- "Name",
- "Name desc",
- "Budget",
- "Budget desc",
- "Description",
- "Description desc",
- "Tags",
- "Tags desc",
+ "PlanItemId",
+ "PlanItemId desc",
+ "ConfirmationCode",
+ "ConfirmationCode desc",
"StartsAt",
"StartsAt desc",
"EndsAt",
- "EndsAt desc"
+ "EndsAt desc",
+ "Duration",
+ "Duration desc"
+ ],
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "$select",
+ "description": "Select properties to be returned",
+ "type": "array",
+ "items": {
+ "enum": [
+ "PlanItemId",
+ "ConfirmationCode",
+ "StartsAt",
+ "EndsAt",
+ "Duration"
+ ],
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "$expand",
+ "description": "Expand related entities",
+ "type": "array",
+ "items": {
+ "enum": [
+ "*"
],
"type": "string"
}
@@ -3128,15 +3296,15 @@
],
"responses": {
"200": {
- "description": "Retrieved navigation property links",
+ "description": "Retrieved navigation property",
"schema": {
- "title": "Collection of links of Trip",
+ "title": "Collection of PlanItem",
"type": "object",
"properties": {
"value": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem"
}
}
}
@@ -3147,16 +3315,15 @@
}
},
"x-ms-docs-operation-type": "operation"
- },
- "post": {
+ }
+ },
+ "/NewComePeople/{UserName}/Trips/{TripId}/PlanItems/$ref": {
+ "get": {
"tags": [
- "NewComePeople.Trip"
- ],
- "summary": "Create new navigation property ref to Trips for NewComePeople",
- "operationId": "NewComePeople.CreateRefTrips",
- "consumes": [
- "application/json"
+ "NewComePeople.Trips.PlanItem"
],
+ "summary": "Get ref of PlanItems from NewComePeople",
+ "operationId": "NewComePeople.Trips.ListRefPlanItems",
"produces": [
"application/json"
],
@@ -3170,20 +3337,67 @@
"x-ms-docs-key-type": "Person"
},
{
- "in": "body",
- "name": "body",
- "description": "New navigation property ref value",
+ "in": "path",
+ "name": "TripId",
+ "description": "key: TripId of Trip",
"required": true,
- "schema": {
- "type": "String"
+ "type": "integer",
+ "format": "int32",
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "x-ms-docs-key-type": "Trip"
+ },
+ {
+ "$ref": "#/parameters/top"
+ },
+ {
+ "$ref": "#/parameters/skip"
+ },
+ {
+ "$ref": "#/parameters/search"
+ },
+ {
+ "$ref": "#/parameters/filter"
+ },
+ {
+ "$ref": "#/parameters/count"
+ },
+ {
+ "in": "query",
+ "name": "$orderby",
+ "description": "Order items by property values",
+ "type": "array",
+ "items": {
+ "enum": [
+ "PlanItemId",
+ "PlanItemId desc",
+ "ConfirmationCode",
+ "ConfirmationCode desc",
+ "StartsAt",
+ "StartsAt desc",
+ "EndsAt",
+ "EndsAt desc",
+ "Duration",
+ "Duration desc"
+ ],
+ "type": "string"
}
}
],
"responses": {
- "201": {
- "description": "Created navigation property link.",
+ "200": {
+ "description": "Retrieved navigation property links",
"schema": {
- "type": "String"
+ "title": "Collection of links of PlanItem",
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
}
},
"default": {
@@ -3192,12 +3406,18 @@
},
"x-ms-docs-operation-type": "operation"
},
- "delete": {
+ "post": {
"tags": [
- "NewComePeople.Trip"
+ "NewComePeople.Trips.PlanItem"
+ ],
+ "summary": "Create new navigation property ref to PlanItems for NewComePeople",
+ "operationId": "NewComePeople.Trips.CreateRefPlanItems",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
],
- "summary": "Delete ref of navigation property Trips for NewComePeople",
- "operationId": "NewComePeople.DeleteRefTrips",
"parameters": [
{
"in": "path",
@@ -3208,21 +3428,35 @@
"x-ms-docs-key-type": "Person"
},
{
- "in": "header",
- "name": "If-Match",
- "description": "ETag",
- "type": "string"
+ "in": "path",
+ "name": "TripId",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "type": "integer",
+ "format": "int32",
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "x-ms-docs-key-type": "Trip"
},
{
- "in": "query",
- "name": "@id",
- "description": "Delete Uri",
- "type": "string"
+ "in": "body",
+ "name": "body",
+ "description": "New navigation property ref value",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
+ }
}
],
"responses": {
- "204": {
- "description": "Success"
+ "201": {
+ "description": "Created navigation property link.",
+ "schema": {
+ "type": "object"
+ }
},
"default": {
"$ref": "#/responses/error"
@@ -3640,7 +3874,7 @@
},
"x-ms-docs-operation-type": "operation"
},
- "patch": {
+ "put": {
"tags": [
"People.Person"
],
@@ -3664,7 +3898,10 @@
"description": "New navigation property ref values",
"required": true,
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
],
@@ -3842,88 +4079,6 @@
"x-ms-docs-operation-type": "operation"
}
},
- "/People/{UserName}/Friends/{UserName1}": {
- "get": {
- "tags": [
- "People.Person"
- ],
- "summary": "Get Friends from People",
- "operationId": "People.GetFriends",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "UserName",
- "description": "key: UserName of Person",
- "required": true,
- "type": "string",
- "x-ms-docs-key-type": "Person"
- },
- {
- "in": "path",
- "name": "UserName1",
- "description": "key: UserName of Person",
- "required": true,
- "type": "string",
- "x-ms-docs-key-type": "Person"
- },
- {
- "in": "query",
- "name": "$select",
- "description": "Select properties to be returned",
- "type": "array",
- "items": {
- "enum": [
- "UserName",
- "FirstName",
- "LastName",
- "MiddleName",
- "Gender",
- "Age",
- "Emails",
- "AddressInfo",
- "HomeAddress",
- "FavoriteFeature",
- "Features",
- "Friends",
- "BestFriend",
- "Trips"
- ],
- "type": "string"
- }
- },
- {
- "in": "query",
- "name": "$expand",
- "description": "Expand related entities",
- "type": "array",
- "items": {
- "enum": [
- "*",
- "Friends",
- "BestFriend",
- "Trips"
- ],
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Retrieved navigation property",
- "schema": {
- "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
- }
- },
- "default": {
- "$ref": "#/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
- }
- },
"/People/{UserName}/Friends/$ref": {
"get": {
"tags": [
@@ -4041,7 +4196,10 @@
"description": "New navigation property ref value",
"required": true,
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
],
@@ -4049,7 +4207,7 @@
"201": {
"description": "Created navigation property link.",
"schema": {
- "type": "String"
+ "type": "object"
}
},
"default": {
@@ -4057,44 +4215,6 @@
}
},
"x-ms-docs-operation-type": "operation"
- },
- "delete": {
- "tags": [
- "People.Person"
- ],
- "summary": "Delete ref of navigation property Friends for People",
- "operationId": "People.DeleteRefFriends",
- "parameters": [
- {
- "in": "path",
- "name": "UserName",
- "description": "key: UserName of Person",
- "required": true,
- "type": "string",
- "x-ms-docs-key-type": "Person"
- },
- {
- "in": "header",
- "name": "If-Match",
- "description": "ETag",
- "type": "string"
- },
- {
- "in": "query",
- "name": "@id",
- "description": "Delete Uri",
- "type": "string"
- }
- ],
- "responses": {
- "204": {
- "description": "Success"
- },
- "default": {
- "$ref": "#/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
}
},
"/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": {
@@ -4282,16 +4402,389 @@
"$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})": {
+ "get": {
+ "tags": [
+ "People.Functions"
+ ],
+ "summary": "Invoke function UpdatePersonLastName",
+ "operationId": "People.UpdatePersonLastName",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "UserName",
+ "description": "key: UserName of Person",
+ "required": true,
+ "type": "string",
+ "x-ms-docs-key-type": "Person"
+ },
+ {
+ "in": "path",
+ "name": "lastName",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "schema": {
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "default": {
+ "$ref": "#/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "function"
+ }
+ },
+ "/People/{UserName}/Trips": {
+ "get": {
+ "tags": [
+ "People.Trip"
+ ],
+ "summary": "Get Trips from People",
+ "operationId": "People.ListTrips",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "UserName",
+ "description": "key: UserName of Person",
+ "required": true,
+ "type": "string",
+ "x-ms-docs-key-type": "Person"
+ },
+ {
+ "$ref": "#/parameters/top"
+ },
+ {
+ "$ref": "#/parameters/skip"
+ },
+ {
+ "$ref": "#/parameters/search"
+ },
+ {
+ "$ref": "#/parameters/filter"
+ },
+ {
+ "$ref": "#/parameters/count"
+ },
+ {
+ "in": "query",
+ "name": "$orderby",
+ "description": "Order items by property values",
+ "type": "array",
+ "items": {
+ "enum": [
+ "TripId",
+ "TripId desc",
+ "ShareId",
+ "ShareId desc",
+ "Name",
+ "Name desc",
+ "Budget",
+ "Budget desc",
+ "Description",
+ "Description desc",
+ "Tags",
+ "Tags desc",
+ "StartsAt",
+ "StartsAt desc",
+ "EndsAt",
+ "EndsAt desc"
+ ],
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "$select",
+ "description": "Select properties to be returned",
+ "type": "array",
+ "items": {
+ "enum": [
+ "TripId",
+ "ShareId",
+ "Name",
+ "Budget",
+ "Description",
+ "Tags",
+ "StartsAt",
+ "EndsAt",
+ "PlanItems"
+ ],
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "$expand",
+ "description": "Expand related entities",
+ "type": "array",
+ "items": {
+ "enum": [
+ "*",
+ "PlanItems"
+ ],
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Retrieved navigation property",
+ "schema": {
+ "title": "Collection of Trip",
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ }
+ }
+ }
+ }
+ },
+ "default": {
+ "$ref": "#/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "operation"
+ },
+ "post": {
+ "tags": [
+ "People.Trip"
+ ],
+ "summary": "Create new navigation property to Trips for People",
+ "operationId": "People.CreateTrips",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "UserName",
+ "description": "key: UserName of Person",
+ "required": true,
+ "type": "string",
+ "x-ms-docs-key-type": "Person"
+ },
+ {
+ "in": "body",
+ "name": "body",
+ "description": "New navigation property",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ }
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Created navigation property.",
+ "schema": {
+ "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ }
+ },
+ "default": {
+ "$ref": "#/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "operation"
+ }
+ },
+ "/People/{UserName}/Trips/{TripId}": {
+ "get": {
+ "tags": [
+ "People.Trip"
+ ],
+ "summary": "Get Trips from People",
+ "operationId": "People.GetTrips",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "UserName",
+ "description": "key: UserName of Person",
+ "required": true,
+ "type": "string",
+ "x-ms-docs-key-type": "Person"
+ },
+ {
+ "in": "path",
+ "name": "TripId",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "type": "integer",
+ "format": "int32",
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "x-ms-docs-key-type": "Trip"
+ },
+ {
+ "in": "query",
+ "name": "$select",
+ "description": "Select properties to be returned",
+ "type": "array",
+ "items": {
+ "enum": [
+ "TripId",
+ "ShareId",
+ "Name",
+ "Budget",
+ "Description",
+ "Tags",
+ "StartsAt",
+ "EndsAt",
+ "PlanItems"
+ ],
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "$expand",
+ "description": "Expand related entities",
+ "type": "array",
+ "items": {
+ "enum": [
+ "*",
+ "PlanItems"
+ ],
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Retrieved navigation property",
+ "schema": {
+ "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ }
+ },
+ "default": {
+ "$ref": "#/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "operation"
+ },
+ "patch": {
+ "tags": [
+ "People.Trip"
+ ],
+ "summary": "Update the navigation property Trips in People",
+ "operationId": "People.UpdateTrips",
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "UserName",
+ "description": "key: UserName of Person",
+ "required": true,
+ "type": "string",
+ "x-ms-docs-key-type": "Person"
+ },
+ {
+ "in": "path",
+ "name": "TripId",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "type": "integer",
+ "format": "int32",
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "x-ms-docs-key-type": "Trip"
+ },
+ {
+ "in": "body",
+ "name": "body",
+ "description": "New navigation property values",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Success"
+ },
+ "default": {
+ "$ref": "#/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "operation"
+ },
+ "delete": {
+ "tags": [
+ "People.Trip"
+ ],
+ "summary": "Delete navigation property Trips for People",
+ "operationId": "People.DeleteTrips",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "UserName",
+ "description": "key: UserName of Person",
+ "required": true,
+ "type": "string",
+ "x-ms-docs-key-type": "Person"
+ },
+ {
+ "in": "path",
+ "name": "TripId",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "type": "integer",
+ "format": "int32",
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "x-ms-docs-key-type": "Trip"
+ },
+ {
+ "in": "header",
+ "name": "If-Match",
+ "description": "ETag",
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Success"
+ },
+ "default": {
+ "$ref": "#/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "operation"
}
},
- "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName={lastName})": {
+ "/People/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": {
"get": {
"tags": [
"People.Functions"
],
- "summary": "Invoke function UpdatePersonLastName",
- "operationId": "People.UpdatePersonLastName",
+ "summary": "Invoke function GetInvolvedPeople",
+ "operationId": "People.Trips.GetInvolvedPeople",
"produces": [
"application/json"
],
@@ -4306,17 +4799,24 @@
},
{
"in": "path",
- "name": "lastName",
+ "name": "TripId",
+ "description": "key: TripId of Trip",
"required": true,
- "type": "string"
+ "type": "integer",
+ "format": "int32",
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "x-ms-docs-key-type": "Trip"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
- "default": false,
- "type": "boolean"
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
+ }
}
},
"default": {
@@ -4326,13 +4826,13 @@
"x-ms-docs-operation-type": "function"
}
},
- "/People/{UserName}/Trips": {
+ "/People/{UserName}/Trips/{TripId}/PlanItems": {
"get": {
"tags": [
- "People.Trip"
+ "People.Trips.PlanItem"
],
- "summary": "Get Trips from People",
- "operationId": "People.ListTrips",
+ "summary": "Get PlanItems from People",
+ "operationId": "People.Trips.ListPlanItems",
"produces": [
"application/json"
],
@@ -4345,6 +4845,17 @@
"type": "string",
"x-ms-docs-key-type": "Person"
},
+ {
+ "in": "path",
+ "name": "TripId",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "type": "integer",
+ "format": "int32",
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "x-ms-docs-key-type": "Trip"
+ },
{
"$ref": "#/parameters/top"
},
@@ -4367,22 +4878,16 @@
"type": "array",
"items": {
"enum": [
- "TripId",
- "TripId desc",
- "ShareId",
- "ShareId desc",
- "Name",
- "Name desc",
- "Budget",
- "Budget desc",
- "Description",
- "Description desc",
- "Tags",
- "Tags desc",
+ "PlanItemId",
+ "PlanItemId desc",
+ "ConfirmationCode",
+ "ConfirmationCode desc",
"StartsAt",
"StartsAt desc",
"EndsAt",
- "EndsAt desc"
+ "EndsAt desc",
+ "Duration",
+ "Duration desc"
],
"type": "string"
}
@@ -4394,15 +4899,11 @@
"type": "array",
"items": {
"enum": [
- "TripId",
- "ShareId",
- "Name",
- "Budget",
- "Description",
- "Tags",
+ "PlanItemId",
+ "ConfirmationCode",
"StartsAt",
"EndsAt",
- "PlanItems"
+ "Duration"
],
"type": "string"
}
@@ -4414,8 +4915,7 @@
"type": "array",
"items": {
"enum": [
- "*",
- "PlanItems"
+ "*"
],
"type": "string"
}
@@ -4425,13 +4925,13 @@
"200": {
"description": "Retrieved navigation property",
"schema": {
- "title": "Collection of Trip",
+ "title": "Collection of PlanItem",
"type": "object",
"properties": {
"value": {
"type": "array",
"items": {
- "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem"
}
}
}
@@ -4444,91 +4944,13 @@
"x-ms-docs-operation-type": "operation"
}
},
- "/People/{UserName}/Trips/{TripId}": {
- "get": {
- "tags": [
- "People.Trip"
- ],
- "summary": "Get Trips from People",
- "operationId": "People.GetTrips",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "UserName",
- "description": "key: UserName of Person",
- "required": true,
- "type": "string",
- "x-ms-docs-key-type": "Person"
- },
- {
- "in": "path",
- "name": "TripId",
- "description": "key: TripId of Trip",
- "required": true,
- "type": "integer",
- "format": "int32",
- "maximum": 2147483647,
- "minimum": -2147483648,
- "x-ms-docs-key-type": "Trip"
- },
- {
- "in": "query",
- "name": "$select",
- "description": "Select properties to be returned",
- "type": "array",
- "items": {
- "enum": [
- "TripId",
- "ShareId",
- "Name",
- "Budget",
- "Description",
- "Tags",
- "StartsAt",
- "EndsAt",
- "PlanItems"
- ],
- "type": "string"
- }
- },
- {
- "in": "query",
- "name": "$expand",
- "description": "Expand related entities",
- "type": "array",
- "items": {
- "enum": [
- "*",
- "PlanItems"
- ],
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Retrieved navigation property",
- "schema": {
- "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
- }
- },
- "default": {
- "$ref": "#/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
- }
- },
- "/People/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": {
+ "/People/{UserName}/Trips/{TripId}/PlanItems/$ref": {
"get": {
"tags": [
- "People.Functions"
+ "People.Trips.PlanItem"
],
- "summary": "Invoke function GetInvolvedPeople",
- "operationId": "People.Trips.GetInvolvedPeople",
+ "summary": "Get ref of PlanItems from People",
+ "operationId": "People.Trips.ListRefPlanItems",
"produces": [
"application/json"
],
@@ -4551,43 +4973,6 @@
"maximum": 2147483647,
"minimum": -2147483648,
"x-ms-docs-key-type": "Trip"
- }
- ],
- "responses": {
- "200": {
- "description": "Success",
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
- }
- }
- },
- "default": {
- "$ref": "#/responses/error"
- }
- },
- "x-ms-docs-operation-type": "function"
- }
- },
- "/People/{UserName}/Trips/$ref": {
- "get": {
- "tags": [
- "People.Trip"
- ],
- "summary": "Get ref of Trips from People",
- "operationId": "People.ListRefTrips",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "UserName",
- "description": "key: UserName of Person",
- "required": true,
- "type": "string",
- "x-ms-docs-key-type": "Person"
},
{
"$ref": "#/parameters/top"
@@ -4611,22 +4996,16 @@
"type": "array",
"items": {
"enum": [
- "TripId",
- "TripId desc",
- "ShareId",
- "ShareId desc",
- "Name",
- "Name desc",
- "Budget",
- "Budget desc",
- "Description",
- "Description desc",
- "Tags",
- "Tags desc",
+ "PlanItemId",
+ "PlanItemId desc",
+ "ConfirmationCode",
+ "ConfirmationCode desc",
"StartsAt",
"StartsAt desc",
"EndsAt",
- "EndsAt desc"
+ "EndsAt desc",
+ "Duration",
+ "Duration desc"
],
"type": "string"
}
@@ -4636,7 +5015,7 @@
"200": {
"description": "Retrieved navigation property links",
"schema": {
- "title": "Collection of links of Trip",
+ "title": "Collection of links of PlanItem",
"type": "object",
"properties": {
"value": {
@@ -4656,10 +5035,10 @@
},
"post": {
"tags": [
- "People.Trip"
+ "People.Trips.PlanItem"
],
- "summary": "Create new navigation property ref to Trips for People",
- "operationId": "People.CreateRefTrips",
+ "summary": "Create new navigation property ref to PlanItems for People",
+ "operationId": "People.Trips.CreateRefPlanItems",
"consumes": [
"application/json"
],
@@ -4675,13 +5054,27 @@
"type": "string",
"x-ms-docs-key-type": "Person"
},
+ {
+ "in": "path",
+ "name": "TripId",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "type": "integer",
+ "format": "int32",
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "x-ms-docs-key-type": "Trip"
+ },
{
"in": "body",
"name": "body",
"description": "New navigation property ref value",
"required": true,
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
],
@@ -4689,7 +5082,7 @@
"201": {
"description": "Created navigation property link.",
"schema": {
- "type": "String"
+ "type": "object"
}
},
"default": {
@@ -4697,44 +5090,6 @@
}
},
"x-ms-docs-operation-type": "operation"
- },
- "delete": {
- "tags": [
- "People.Trip"
- ],
- "summary": "Delete ref of navigation property Trips for People",
- "operationId": "People.DeleteRefTrips",
- "parameters": [
- {
- "in": "path",
- "name": "UserName",
- "description": "key: UserName of Person",
- "required": true,
- "type": "string",
- "x-ms-docs-key-type": "Person"
- },
- {
- "in": "header",
- "name": "If-Match",
- "description": "ETag",
- "type": "string"
- },
- {
- "in": "query",
- "name": "@id",
- "description": "Delete Uri",
- "type": "string"
- }
- ],
- "responses": {
- "204": {
- "description": "Success"
- },
- "default": {
- "$ref": "#/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
}
},
"/ResetDataSource": {
@@ -5435,6 +5790,10 @@
"name": "Me.Trip",
"x-ms-docs-toc-type": "page"
},
+ {
+ "name": "Me.Trips.PlanItem",
+ "x-ms-docs-toc-type": "page"
+ },
{
"name": "NewComePeople.Person",
"x-ms-docs-toc-type": "page"
@@ -5451,6 +5810,10 @@
"name": "NewComePeople.Trip",
"x-ms-docs-toc-type": "page"
},
+ {
+ "name": "NewComePeople.Trips.PlanItem",
+ "x-ms-docs-toc-type": "page"
+ },
{
"name": "People.Person",
"x-ms-docs-toc-type": "page"
@@ -5467,6 +5830,10 @@
"name": "People.Trip",
"x-ms-docs-toc-type": "page"
},
+ {
+ "name": "People.Trips.PlanItem",
+ "x-ms-docs-toc-type": "page"
+ },
{
"name": "ResetDataSource",
"x-ms-docs-toc-type": "container"
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml
index 0cb2eff2..1fb3317c 100644
--- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml
@@ -525,7 +525,7 @@ paths:
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
- patch:
+ put:
tags:
- Me.Person
summary: Update the ref of navigation property BestFriend in Me
@@ -538,7 +538,9 @@ paths:
description: New navigation property ref values
required: true
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
responses:
'204':
description: Success
@@ -650,61 +652,6 @@ paths:
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
- '/Me/Friends/{UserName}':
- get:
- tags:
- - Me.Person
- summary: Get Friends from Me
- operationId: Me.GetFriends
- produces:
- - application/json
- parameters:
- - in: path
- name: UserName
- description: 'key: UserName of Person'
- required: true
- type: string
- x-ms-docs-key-type: Person
- - in: query
- name: $select
- description: Select properties to be returned
- type: array
- items:
- enum:
- - UserName
- - FirstName
- - LastName
- - MiddleName
- - Gender
- - Age
- - Emails
- - AddressInfo
- - HomeAddress
- - FavoriteFeature
- - Features
- - Friends
- - BestFriend
- - Trips
- type: string
- - in: query
- name: $expand
- description: Expand related entities
- type: array
- items:
- enum:
- - '*'
- - Friends
- - BestFriend
- - Trips
- type: string
- responses:
- '200':
- description: Retrieved navigation property
- schema:
- $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person'
- default:
- $ref: '#/responses/error'
- x-ms-docs-operation-type: operation
/Me/Friends/$ref:
get:
tags:
@@ -777,32 +724,14 @@ paths:
description: New navigation property ref value
required: true
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
responses:
'201':
description: Created navigation property link.
schema:
- type: String
- default:
- $ref: '#/responses/error'
- x-ms-docs-operation-type: operation
- delete:
- tags:
- - Me.Person
- summary: Delete ref of navigation property Friends for Me
- operationId: Me.DeleteRefFriends
- parameters:
- - in: header
- name: If-Match
- description: ETag
- type: string
- - in: query
- name: '@id'
- description: Delete Uri
- type: string
- responses:
- '204':
- description: Success
+ type: object
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
@@ -1007,6 +936,30 @@ paths:
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
+ post:
+ tags:
+ - Me.Trip
+ summary: Create new navigation property to Trips for Me
+ operationId: Me.CreateTrips
+ consumes:
+ - application/json
+ produces:
+ - application/json
+ parameters:
+ - in: body
+ name: body
+ description: New navigation property
+ required: true
+ schema:
+ $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ responses:
+ '201':
+ description: Created navigation property.
+ schema:
+ $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ default:
+ $ref: '#/responses/error'
+ x-ms-docs-operation-type: operation
'/Me/Trips/{TripId}':
get:
tags:
@@ -1058,6 +1011,60 @@ paths:
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
+ patch:
+ tags:
+ - Me.Trip
+ summary: Update the navigation property Trips in Me
+ operationId: Me.UpdateTrips
+ consumes:
+ - application/json
+ parameters:
+ - in: path
+ name: TripId
+ description: 'key: TripId of Trip'
+ required: true
+ type: integer
+ format: int32
+ maximum: 2147483647
+ minimum: -2147483648
+ x-ms-docs-key-type: Trip
+ - in: body
+ name: body
+ description: New navigation property values
+ required: true
+ schema:
+ $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ responses:
+ '204':
+ description: Success
+ default:
+ $ref: '#/responses/error'
+ x-ms-docs-operation-type: operation
+ delete:
+ tags:
+ - Me.Trip
+ summary: Delete navigation property Trips for Me
+ operationId: Me.DeleteTrips
+ parameters:
+ - in: path
+ name: TripId
+ description: 'key: TripId of Trip'
+ required: true
+ type: integer
+ format: int32
+ maximum: 2147483647
+ minimum: -2147483648
+ x-ms-docs-key-type: Trip
+ - in: header
+ name: If-Match
+ description: ETag
+ type: string
+ responses:
+ '204':
+ description: Success
+ default:
+ $ref: '#/responses/error'
+ x-ms-docs-operation-type: operation
'/Me/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()':
get:
tags:
@@ -1086,15 +1093,24 @@ paths:
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: function
- /Me/Trips/$ref:
+ '/Me/Trips/{TripId}/PlanItems':
get:
tags:
- - Me.Trip
- summary: Get ref of Trips from Me
- operationId: Me.ListRefTrips
+ - Me.Trips.PlanItem
+ summary: Get PlanItems from Me
+ operationId: Me.Trips.ListPlanItems
produces:
- application/json
parameters:
+ - in: path
+ name: TripId
+ description: 'key: TripId of Trip'
+ required: true
+ type: integer
+ format: int32
+ maximum: 2147483647
+ minimum: -2147483648
+ x-ms-docs-key-type: Trip
- $ref: '#/parameters/top'
- $ref: '#/parameters/skip'
- $ref: '#/parameters/search'
@@ -1106,28 +1122,96 @@ paths:
type: array
items:
enum:
- - TripId
- - TripId desc
- - ShareId
- - ShareId desc
- - Name
- - Name desc
- - Budget
- - Budget desc
- - Description
- - Description desc
- - Tags
- - Tags desc
+ - PlanItemId
+ - PlanItemId desc
+ - ConfirmationCode
+ - ConfirmationCode desc
+ - StartsAt
+ - StartsAt desc
+ - EndsAt
+ - EndsAt desc
+ - Duration
+ - Duration desc
+ type: string
+ - in: query
+ name: $select
+ description: Select properties to be returned
+ type: array
+ items:
+ enum:
+ - PlanItemId
+ - ConfirmationCode
+ - StartsAt
+ - EndsAt
+ - Duration
+ type: string
+ - in: query
+ name: $expand
+ description: Expand related entities
+ type: array
+ items:
+ enum:
+ - '*'
+ type: string
+ responses:
+ '200':
+ description: Retrieved navigation property
+ schema:
+ title: Collection of PlanItem
+ type: object
+ properties:
+ value:
+ type: array
+ items:
+ $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem'
+ default:
+ $ref: '#/responses/error'
+ x-ms-docs-operation-type: operation
+ '/Me/Trips/{TripId}/PlanItems/$ref':
+ get:
+ tags:
+ - Me.Trips.PlanItem
+ summary: Get ref of PlanItems from Me
+ operationId: Me.Trips.ListRefPlanItems
+ produces:
+ - application/json
+ parameters:
+ - in: path
+ name: TripId
+ description: 'key: TripId of Trip'
+ required: true
+ type: integer
+ format: int32
+ maximum: 2147483647
+ minimum: -2147483648
+ x-ms-docs-key-type: Trip
+ - $ref: '#/parameters/top'
+ - $ref: '#/parameters/skip'
+ - $ref: '#/parameters/search'
+ - $ref: '#/parameters/filter'
+ - $ref: '#/parameters/count'
+ - in: query
+ name: $orderby
+ description: Order items by property values
+ type: array
+ items:
+ enum:
+ - PlanItemId
+ - PlanItemId desc
+ - ConfirmationCode
+ - ConfirmationCode desc
- StartsAt
- StartsAt desc
- EndsAt
- EndsAt desc
+ - Duration
+ - Duration desc
type: string
responses:
'200':
description: Retrieved navigation property links
schema:
- title: Collection of links of Trip
+ title: Collection of links of PlanItem
type: object
properties:
value:
@@ -1139,45 +1223,36 @@ paths:
x-ms-docs-operation-type: operation
post:
tags:
- - Me.Trip
- summary: Create new navigation property ref to Trips for Me
- operationId: Me.CreateRefTrips
+ - Me.Trips.PlanItem
+ summary: Create new navigation property ref to PlanItems for Me
+ operationId: Me.Trips.CreateRefPlanItems
consumes:
- application/json
produces:
- application/json
parameters:
+ - in: path
+ name: TripId
+ description: 'key: TripId of Trip'
+ required: true
+ type: integer
+ format: int32
+ maximum: 2147483647
+ minimum: -2147483648
+ x-ms-docs-key-type: Trip
- in: body
name: body
description: New navigation property ref value
required: true
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
responses:
'201':
description: Created navigation property link.
schema:
- type: String
- default:
- $ref: '#/responses/error'
- x-ms-docs-operation-type: operation
- delete:
- tags:
- - Me.Trip
- summary: Delete ref of navigation property Trips for Me
- operationId: Me.DeleteRefTrips
- parameters:
- - in: header
- name: If-Match
- description: ETag
- type: string
- - in: query
- name: '@id'
- description: Delete Uri
- type: string
- responses:
- '204':
- description: Success
+ type: object
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
@@ -1474,7 +1549,7 @@ paths:
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
- patch:
+ put:
tags:
- NewComePeople.Person
summary: Update the ref of navigation property BestFriend in NewComePeople
@@ -1493,7 +1568,9 @@ paths:
description: New navigation property ref values
required: true
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
responses:
'204':
description: Success
@@ -1617,68 +1694,7 @@ paths:
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
- '/NewComePeople/{UserName}/Friends/{UserName1}':
- get:
- tags:
- - NewComePeople.Person
- summary: Get Friends from NewComePeople
- operationId: NewComePeople.GetFriends
- produces:
- - application/json
- parameters:
- - in: path
- name: UserName
- description: 'key: UserName of Person'
- required: true
- type: string
- x-ms-docs-key-type: Person
- - in: path
- name: UserName1
- description: 'key: UserName of Person'
- required: true
- type: string
- x-ms-docs-key-type: Person
- - in: query
- name: $select
- description: Select properties to be returned
- type: array
- items:
- enum:
- - UserName
- - FirstName
- - LastName
- - MiddleName
- - Gender
- - Age
- - Emails
- - AddressInfo
- - HomeAddress
- - FavoriteFeature
- - Features
- - Friends
- - BestFriend
- - Trips
- type: string
- - in: query
- name: $expand
- description: Expand related entities
- type: array
- items:
- enum:
- - '*'
- - Friends
- - BestFriend
- - Trips
- type: string
- responses:
- '200':
- description: Retrieved navigation property
- schema:
- $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person'
- default:
- $ref: '#/responses/error'
- x-ms-docs-operation-type: operation
- '/NewComePeople/{UserName}/Friends/$ref':
+ '/NewComePeople/{UserName}/Friends/$ref':
get:
tags:
- NewComePeople.Person
@@ -1762,38 +1778,14 @@ paths:
description: New navigation property ref value
required: true
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
responses:
'201':
description: Created navigation property link.
schema:
- type: String
- default:
- $ref: '#/responses/error'
- x-ms-docs-operation-type: operation
- delete:
- tags:
- - NewComePeople.Person
- summary: Delete ref of navigation property Friends for NewComePeople
- operationId: NewComePeople.DeleteRefFriends
- parameters:
- - in: path
- name: UserName
- description: 'key: UserName of Person'
- required: true
- type: string
- x-ms-docs-key-type: Person
- - in: header
- name: If-Match
- description: ETag
- type: string
- - in: query
- name: '@id'
- description: Delete Uri
- type: string
- responses:
- '204':
- description: Success
+ type: object
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
@@ -2035,6 +2027,36 @@ paths:
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
+ post:
+ tags:
+ - NewComePeople.Trip
+ summary: Create new navigation property to Trips for NewComePeople
+ operationId: NewComePeople.CreateTrips
+ consumes:
+ - application/json
+ produces:
+ - application/json
+ parameters:
+ - in: path
+ name: UserName
+ description: 'key: UserName of Person'
+ required: true
+ type: string
+ x-ms-docs-key-type: Person
+ - in: body
+ name: body
+ description: New navigation property
+ required: true
+ schema:
+ $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ responses:
+ '201':
+ description: Created navigation property.
+ schema:
+ $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ default:
+ $ref: '#/responses/error'
+ x-ms-docs-operation-type: operation
'/NewComePeople/{UserName}/Trips/{TripId}':
get:
tags:
@@ -2092,6 +2114,72 @@ paths:
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
+ patch:
+ tags:
+ - NewComePeople.Trip
+ summary: Update the navigation property Trips in NewComePeople
+ operationId: NewComePeople.UpdateTrips
+ consumes:
+ - application/json
+ parameters:
+ - in: path
+ name: UserName
+ description: 'key: UserName of Person'
+ required: true
+ type: string
+ x-ms-docs-key-type: Person
+ - in: path
+ name: TripId
+ description: 'key: TripId of Trip'
+ required: true
+ type: integer
+ format: int32
+ maximum: 2147483647
+ minimum: -2147483648
+ x-ms-docs-key-type: Trip
+ - in: body
+ name: body
+ description: New navigation property values
+ required: true
+ schema:
+ $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ responses:
+ '204':
+ description: Success
+ default:
+ $ref: '#/responses/error'
+ x-ms-docs-operation-type: operation
+ delete:
+ tags:
+ - NewComePeople.Trip
+ summary: Delete navigation property Trips for NewComePeople
+ operationId: NewComePeople.DeleteTrips
+ parameters:
+ - in: path
+ name: UserName
+ description: 'key: UserName of Person'
+ required: true
+ type: string
+ x-ms-docs-key-type: Person
+ - in: path
+ name: TripId
+ description: 'key: TripId of Trip'
+ required: true
+ type: integer
+ format: int32
+ maximum: 2147483647
+ minimum: -2147483648
+ x-ms-docs-key-type: Trip
+ - in: header
+ name: If-Match
+ description: ETag
+ type: string
+ responses:
+ '204':
+ description: Success
+ default:
+ $ref: '#/responses/error'
+ x-ms-docs-operation-type: operation
'/NewComePeople/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()':
get:
tags:
@@ -2126,12 +2214,12 @@ paths:
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: function
- '/NewComePeople/{UserName}/Trips/$ref':
+ '/NewComePeople/{UserName}/Trips/{TripId}/PlanItems':
get:
tags:
- - NewComePeople.Trip
- summary: Get ref of Trips from NewComePeople
- operationId: NewComePeople.ListRefTrips
+ - NewComePeople.Trips.PlanItem
+ summary: Get PlanItems from NewComePeople
+ operationId: NewComePeople.Trips.ListPlanItems
produces:
- application/json
parameters:
@@ -2141,6 +2229,15 @@ paths:
required: true
type: string
x-ms-docs-key-type: Person
+ - in: path
+ name: TripId
+ description: 'key: TripId of Trip'
+ required: true
+ type: integer
+ format: int32
+ maximum: 2147483647
+ minimum: -2147483648
+ x-ms-docs-key-type: Trip
- $ref: '#/parameters/top'
- $ref: '#/parameters/skip'
- $ref: '#/parameters/search'
@@ -2152,44 +2249,57 @@ paths:
type: array
items:
enum:
- - TripId
- - TripId desc
- - ShareId
- - ShareId desc
- - Name
- - Name desc
- - Budget
- - Budget desc
- - Description
- - Description desc
- - Tags
- - Tags desc
+ - PlanItemId
+ - PlanItemId desc
+ - ConfirmationCode
+ - ConfirmationCode desc
- StartsAt
- StartsAt desc
- EndsAt
- EndsAt desc
+ - Duration
+ - Duration desc
+ type: string
+ - in: query
+ name: $select
+ description: Select properties to be returned
+ type: array
+ items:
+ enum:
+ - PlanItemId
+ - ConfirmationCode
+ - StartsAt
+ - EndsAt
+ - Duration
+ type: string
+ - in: query
+ name: $expand
+ description: Expand related entities
+ type: array
+ items:
+ enum:
+ - '*'
type: string
responses:
'200':
- description: Retrieved navigation property links
+ description: Retrieved navigation property
schema:
- title: Collection of links of Trip
+ title: Collection of PlanItem
type: object
properties:
value:
type: array
items:
- type: string
+ $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem'
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
- post:
+ '/NewComePeople/{UserName}/Trips/{TripId}/PlanItems/$ref':
+ get:
tags:
- - NewComePeople.Trip
- summary: Create new navigation property ref to Trips for NewComePeople
- operationId: NewComePeople.CreateRefTrips
- consumes:
- - application/json
+ - NewComePeople.Trips.PlanItem
+ summary: Get ref of PlanItems from NewComePeople
+ operationId: NewComePeople.Trips.ListRefPlanItems
produces:
- application/json
parameters:
@@ -2199,25 +2309,60 @@ paths:
required: true
type: string
x-ms-docs-key-type: Person
- - in: body
- name: body
- description: New navigation property ref value
+ - in: path
+ name: TripId
+ description: 'key: TripId of Trip'
required: true
- schema:
- type: String
+ type: integer
+ format: int32
+ maximum: 2147483647
+ minimum: -2147483648
+ x-ms-docs-key-type: Trip
+ - $ref: '#/parameters/top'
+ - $ref: '#/parameters/skip'
+ - $ref: '#/parameters/search'
+ - $ref: '#/parameters/filter'
+ - $ref: '#/parameters/count'
+ - in: query
+ name: $orderby
+ description: Order items by property values
+ type: array
+ items:
+ enum:
+ - PlanItemId
+ - PlanItemId desc
+ - ConfirmationCode
+ - ConfirmationCode desc
+ - StartsAt
+ - StartsAt desc
+ - EndsAt
+ - EndsAt desc
+ - Duration
+ - Duration desc
+ type: string
responses:
- '201':
- description: Created navigation property link.
+ '200':
+ description: Retrieved navigation property links
schema:
- type: String
+ title: Collection of links of PlanItem
+ type: object
+ properties:
+ value:
+ type: array
+ items:
+ type: string
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
- delete:
+ post:
tags:
- - NewComePeople.Trip
- summary: Delete ref of navigation property Trips for NewComePeople
- operationId: NewComePeople.DeleteRefTrips
+ - NewComePeople.Trips.PlanItem
+ summary: Create new navigation property ref to PlanItems for NewComePeople
+ operationId: NewComePeople.Trips.CreateRefPlanItems
+ consumes:
+ - application/json
+ produces:
+ - application/json
parameters:
- in: path
name: UserName
@@ -2225,17 +2370,28 @@ paths:
required: true
type: string
x-ms-docs-key-type: Person
- - in: header
- name: If-Match
- description: ETag
- type: string
- - in: query
- name: '@id'
- description: Delete Uri
- type: string
+ - in: path
+ name: TripId
+ description: 'key: TripId of Trip'
+ required: true
+ type: integer
+ format: int32
+ maximum: 2147483647
+ minimum: -2147483648
+ x-ms-docs-key-type: Trip
+ - in: body
+ name: body
+ description: New navigation property ref value
+ required: true
+ schema:
+ type: object
+ additionalProperties:
+ type: object
responses:
- '204':
- description: Success
+ '201':
+ description: Created navigation property link.
+ schema:
+ type: object
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
@@ -2532,7 +2688,7 @@ paths:
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
- patch:
+ put:
tags:
- People.Person
summary: Update the ref of navigation property BestFriend in People
@@ -2551,7 +2707,9 @@ paths:
description: New navigation property ref values
required: true
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
responses:
'204':
description: Success
@@ -2614,88 +2772,21 @@ paths:
- LastName desc
- MiddleName
- MiddleName desc
- - Gender
- - Gender desc
- - Age
- - Age desc
- - Emails
- - Emails desc
- - AddressInfo
- - AddressInfo desc
- - HomeAddress
- - HomeAddress desc
- - FavoriteFeature
- - FavoriteFeature desc
- - Features
- - Features desc
- type: string
- - in: query
- name: $select
- description: Select properties to be returned
- type: array
- items:
- enum:
- - UserName
- - FirstName
- - LastName
- - MiddleName
- - Gender
- - Age
- - Emails
- - AddressInfo
- - HomeAddress
- - FavoriteFeature
- - Features
- - Friends
- - BestFriend
- - Trips
- type: string
- - in: query
- name: $expand
- description: Expand related entities
- type: array
- items:
- enum:
- - '*'
- - Friends
- - BestFriend
- - Trips
- type: string
- responses:
- '200':
- description: Retrieved navigation property
- schema:
- title: Collection of Person
- type: object
- properties:
- value:
- type: array
- items:
- $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person'
- default:
- $ref: '#/responses/error'
- x-ms-docs-operation-type: operation
- '/People/{UserName}/Friends/{UserName1}':
- get:
- tags:
- - People.Person
- summary: Get Friends from People
- operationId: People.GetFriends
- produces:
- - application/json
- parameters:
- - in: path
- name: UserName
- description: 'key: UserName of Person'
- required: true
- type: string
- x-ms-docs-key-type: Person
- - in: path
- name: UserName1
- description: 'key: UserName of Person'
- required: true
- type: string
- x-ms-docs-key-type: Person
+ - Gender
+ - Gender desc
+ - Age
+ - Age desc
+ - Emails
+ - Emails desc
+ - AddressInfo
+ - AddressInfo desc
+ - HomeAddress
+ - HomeAddress desc
+ - FavoriteFeature
+ - FavoriteFeature desc
+ - Features
+ - Features desc
+ type: string
- in: query
name: $select
description: Select properties to be returned
@@ -2732,7 +2823,13 @@ paths:
'200':
description: Retrieved navigation property
schema:
- $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person'
+ title: Collection of Person
+ type: object
+ properties:
+ value:
+ type: array
+ items:
+ $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person'
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
@@ -2820,38 +2917,14 @@ paths:
description: New navigation property ref value
required: true
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
responses:
'201':
description: Created navigation property link.
schema:
- type: String
- default:
- $ref: '#/responses/error'
- x-ms-docs-operation-type: operation
- delete:
- tags:
- - People.Person
- summary: Delete ref of navigation property Friends for People
- operationId: People.DeleteRefFriends
- parameters:
- - in: path
- name: UserName
- description: 'key: UserName of Person'
- required: true
- type: string
- x-ms-docs-key-type: Person
- - in: header
- name: If-Match
- description: ETag
- type: string
- - in: query
- name: '@id'
- description: Delete Uri
- type: string
- responses:
- '204':
- description: Success
+ type: object
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
@@ -3093,6 +3166,36 @@ paths:
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
+ post:
+ tags:
+ - People.Trip
+ summary: Create new navigation property to Trips for People
+ operationId: People.CreateTrips
+ consumes:
+ - application/json
+ produces:
+ - application/json
+ parameters:
+ - in: path
+ name: UserName
+ description: 'key: UserName of Person'
+ required: true
+ type: string
+ x-ms-docs-key-type: Person
+ - in: body
+ name: body
+ description: New navigation property
+ required: true
+ schema:
+ $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ responses:
+ '201':
+ description: Created navigation property.
+ schema:
+ $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ default:
+ $ref: '#/responses/error'
+ x-ms-docs-operation-type: operation
'/People/{UserName}/Trips/{TripId}':
get:
tags:
@@ -3150,6 +3253,72 @@ paths:
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
+ patch:
+ tags:
+ - People.Trip
+ summary: Update the navigation property Trips in People
+ operationId: People.UpdateTrips
+ consumes:
+ - application/json
+ parameters:
+ - in: path
+ name: UserName
+ description: 'key: UserName of Person'
+ required: true
+ type: string
+ x-ms-docs-key-type: Person
+ - in: path
+ name: TripId
+ description: 'key: TripId of Trip'
+ required: true
+ type: integer
+ format: int32
+ maximum: 2147483647
+ minimum: -2147483648
+ x-ms-docs-key-type: Trip
+ - in: body
+ name: body
+ description: New navigation property values
+ required: true
+ schema:
+ $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ responses:
+ '204':
+ description: Success
+ default:
+ $ref: '#/responses/error'
+ x-ms-docs-operation-type: operation
+ delete:
+ tags:
+ - People.Trip
+ summary: Delete navigation property Trips for People
+ operationId: People.DeleteTrips
+ parameters:
+ - in: path
+ name: UserName
+ description: 'key: UserName of Person'
+ required: true
+ type: string
+ x-ms-docs-key-type: Person
+ - in: path
+ name: TripId
+ description: 'key: TripId of Trip'
+ required: true
+ type: integer
+ format: int32
+ maximum: 2147483647
+ minimum: -2147483648
+ x-ms-docs-key-type: Trip
+ - in: header
+ name: If-Match
+ description: ETag
+ type: string
+ responses:
+ '204':
+ description: Success
+ default:
+ $ref: '#/responses/error'
+ x-ms-docs-operation-type: operation
'/People/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()':
get:
tags:
@@ -3184,12 +3353,12 @@ paths:
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: function
- '/People/{UserName}/Trips/$ref':
+ '/People/{UserName}/Trips/{TripId}/PlanItems':
get:
tags:
- - People.Trip
- summary: Get ref of Trips from People
- operationId: People.ListRefTrips
+ - People.Trips.PlanItem
+ summary: Get PlanItems from People
+ operationId: People.Trips.ListPlanItems
produces:
- application/json
parameters:
@@ -3199,6 +3368,15 @@ paths:
required: true
type: string
x-ms-docs-key-type: Person
+ - in: path
+ name: TripId
+ description: 'key: TripId of Trip'
+ required: true
+ type: integer
+ format: int32
+ maximum: 2147483647
+ minimum: -2147483648
+ x-ms-docs-key-type: Trip
- $ref: '#/parameters/top'
- $ref: '#/parameters/skip'
- $ref: '#/parameters/search'
@@ -3210,44 +3388,57 @@ paths:
type: array
items:
enum:
- - TripId
- - TripId desc
- - ShareId
- - ShareId desc
- - Name
- - Name desc
- - Budget
- - Budget desc
- - Description
- - Description desc
- - Tags
- - Tags desc
+ - PlanItemId
+ - PlanItemId desc
+ - ConfirmationCode
+ - ConfirmationCode desc
- StartsAt
- StartsAt desc
- EndsAt
- EndsAt desc
+ - Duration
+ - Duration desc
+ type: string
+ - in: query
+ name: $select
+ description: Select properties to be returned
+ type: array
+ items:
+ enum:
+ - PlanItemId
+ - ConfirmationCode
+ - StartsAt
+ - EndsAt
+ - Duration
+ type: string
+ - in: query
+ name: $expand
+ description: Expand related entities
+ type: array
+ items:
+ enum:
+ - '*'
type: string
responses:
'200':
- description: Retrieved navigation property links
+ description: Retrieved navigation property
schema:
- title: Collection of links of Trip
+ title: Collection of PlanItem
type: object
properties:
value:
type: array
items:
- type: string
+ $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem'
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
- post:
+ '/People/{UserName}/Trips/{TripId}/PlanItems/$ref':
+ get:
tags:
- - People.Trip
- summary: Create new navigation property ref to Trips for People
- operationId: People.CreateRefTrips
- consumes:
- - application/json
+ - People.Trips.PlanItem
+ summary: Get ref of PlanItems from People
+ operationId: People.Trips.ListRefPlanItems
produces:
- application/json
parameters:
@@ -3257,25 +3448,60 @@ paths:
required: true
type: string
x-ms-docs-key-type: Person
- - in: body
- name: body
- description: New navigation property ref value
+ - in: path
+ name: TripId
+ description: 'key: TripId of Trip'
required: true
- schema:
- type: String
+ type: integer
+ format: int32
+ maximum: 2147483647
+ minimum: -2147483648
+ x-ms-docs-key-type: Trip
+ - $ref: '#/parameters/top'
+ - $ref: '#/parameters/skip'
+ - $ref: '#/parameters/search'
+ - $ref: '#/parameters/filter'
+ - $ref: '#/parameters/count'
+ - in: query
+ name: $orderby
+ description: Order items by property values
+ type: array
+ items:
+ enum:
+ - PlanItemId
+ - PlanItemId desc
+ - ConfirmationCode
+ - ConfirmationCode desc
+ - StartsAt
+ - StartsAt desc
+ - EndsAt
+ - EndsAt desc
+ - Duration
+ - Duration desc
+ type: string
responses:
- '201':
- description: Created navigation property link.
+ '200':
+ description: Retrieved navigation property links
schema:
- type: String
+ title: Collection of links of PlanItem
+ type: object
+ properties:
+ value:
+ type: array
+ items:
+ type: string
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
- delete:
+ post:
tags:
- - People.Trip
- summary: Delete ref of navigation property Trips for People
- operationId: People.DeleteRefTrips
+ - People.Trips.PlanItem
+ summary: Create new navigation property ref to PlanItems for People
+ operationId: People.Trips.CreateRefPlanItems
+ consumes:
+ - application/json
+ produces:
+ - application/json
parameters:
- in: path
name: UserName
@@ -3283,17 +3509,28 @@ paths:
required: true
type: string
x-ms-docs-key-type: Person
- - in: header
- name: If-Match
- description: ETag
- type: string
- - in: query
- name: '@id'
- description: Delete Uri
- type: string
+ - in: path
+ name: TripId
+ description: 'key: TripId of Trip'
+ required: true
+ type: integer
+ format: int32
+ maximum: 2147483647
+ minimum: -2147483648
+ x-ms-docs-key-type: Trip
+ - in: body
+ name: body
+ description: New navigation property ref value
+ required: true
+ schema:
+ type: object
+ additionalProperties:
+ type: object
responses:
- '204':
- description: Success
+ '201':
+ description: Created navigation property link.
+ schema:
+ type: object
default:
$ref: '#/responses/error'
x-ms-docs-operation-type: operation
@@ -3751,6 +3988,8 @@ tags:
x-ms-docs-toc-type: container
- name: Me.Trip
x-ms-docs-toc-type: page
+ - name: Me.Trips.PlanItem
+ x-ms-docs-toc-type: page
- name: NewComePeople.Person
x-ms-docs-toc-type: page
- name: NewComePeople.Functions
@@ -3759,6 +3998,8 @@ tags:
x-ms-docs-toc-type: container
- name: NewComePeople.Trip
x-ms-docs-toc-type: page
+ - name: NewComePeople.Trips.PlanItem
+ x-ms-docs-toc-type: page
- name: People.Person
x-ms-docs-toc-type: page
- name: People.Functions
@@ -3767,5 +4008,7 @@ tags:
x-ms-docs-toc-type: container
- name: People.Trip
x-ms-docs-toc-type: page
+ - name: People.Trips.PlanItem
+ x-ms-docs-toc-type: page
- name: ResetDataSource
x-ms-docs-toc-type: container
\ No newline at end of file
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json
index 2d306233..9a316bc2 100644
--- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json
@@ -904,7 +904,7 @@
},
"x-ms-docs-operation-type": "operation"
},
- "patch": {
+ "put": {
"tags": [
"Me.Person"
],
@@ -915,7 +915,10 @@
"content": {
"application/json": {
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
},
@@ -1097,93 +1100,6 @@
"x-ms-docs-operation-type": "operation"
}
},
- "/Me/Friends/{UserName}": {
- "get": {
- "tags": [
- "Me.Person"
- ],
- "summary": "Get Friends from Me",
- "operationId": "Me.GetFriends",
- "parameters": [
- {
- "name": "UserName",
- "in": "path",
- "description": "key: UserName of Person",
- "required": true,
- "schema": {
- "type": "string"
- },
- "x-ms-docs-key-type": "Person"
- },
- {
- "name": "$select",
- "in": "query",
- "description": "Select properties to be returned",
- "style": "form",
- "explode": false,
- "schema": {
- "uniqueItems": true,
- "type": "array",
- "items": {
- "enum": [
- "UserName",
- "FirstName",
- "LastName",
- "MiddleName",
- "Gender",
- "Age",
- "Emails",
- "AddressInfo",
- "HomeAddress",
- "FavoriteFeature",
- "Features",
- "Friends",
- "BestFriend",
- "Trips"
- ],
- "type": "string"
- }
- }
- },
- {
- "name": "$expand",
- "in": "query",
- "description": "Expand related entities",
- "style": "form",
- "explode": false,
- "schema": {
- "uniqueItems": true,
- "type": "array",
- "items": {
- "enum": [
- "*",
- "Friends",
- "BestFriend",
- "Trips"
- ],
- "type": "string"
- }
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Retrieved navigation property",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
- }
- }
- }
- },
- "default": {
- "$ref": "#/components/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
- }
- },
"/Me/Friends/$ref": {
"get": {
"tags": [
@@ -1283,7 +1199,10 @@
"content": {
"application/json": {
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
},
@@ -1295,7 +1214,7 @@
"content": {
"application/json": {
"schema": {
- "type": "String"
+ "type": "object"
}
}
}
@@ -1305,40 +1224,6 @@
}
},
"x-ms-docs-operation-type": "operation"
- },
- "delete": {
- "tags": [
- "Me.Person"
- ],
- "summary": "Delete ref of navigation property Friends for Me",
- "operationId": "Me.DeleteRefFriends",
- "parameters": [
- {
- "name": "If-Match",
- "in": "header",
- "description": "ETag",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "@id",
- "in": "query",
- "description": "Delete Uri",
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "204": {
- "description": "Success"
- },
- "default": {
- "$ref": "#/components/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
}
},
"/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": {
@@ -1669,6 +1554,40 @@
}
},
"x-ms-docs-operation-type": "operation"
+ },
+ "post": {
+ "tags": [
+ "Me.Trip"
+ ],
+ "summary": "Create new navigation property to Trips for Me",
+ "operationId": "Me.CreateTrips",
+ "requestBody": {
+ "description": "New navigation property",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "201": {
+ "description": "Created navigation property.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ }
+ }
+ }
+ },
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "operation"
}
},
"/Me/Trips/{TripId}": {
@@ -1752,6 +1671,87 @@
}
},
"x-ms-docs-operation-type": "operation"
+ },
+ "patch": {
+ "tags": [
+ "Me.Trip"
+ ],
+ "summary": "Update the navigation property Trips in Me",
+ "operationId": "Me.UpdateTrips",
+ "parameters": [
+ {
+ "name": "TripId",
+ "in": "path",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "schema": {
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "type": "integer",
+ "format": "int32"
+ },
+ "x-ms-docs-key-type": "Trip"
+ }
+ ],
+ "requestBody": {
+ "description": "New navigation property values",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "204": {
+ "description": "Success"
+ },
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "operation"
+ },
+ "delete": {
+ "tags": [
+ "Me.Trip"
+ ],
+ "summary": "Delete navigation property Trips for Me",
+ "operationId": "Me.DeleteTrips",
+ "parameters": [
+ {
+ "name": "TripId",
+ "in": "path",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "schema": {
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "type": "integer",
+ "format": "int32"
+ },
+ "x-ms-docs-key-type": "Trip"
+ },
+ {
+ "name": "If-Match",
+ "in": "header",
+ "description": "ETag",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Success"
+ },
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "operation"
}
},
"/Me/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": {
@@ -1802,14 +1802,27 @@
"x-ms-docs-operation-type": "function"
}
},
- "/Me/Trips/$ref": {
+ "/Me/Trips/{TripId}/PlanItems": {
"get": {
"tags": [
- "Me.Trip"
+ "Me.Trips.PlanItem"
],
- "summary": "Get ref of Trips from Me",
- "operationId": "Me.ListRefTrips",
+ "summary": "Get PlanItems from Me",
+ "operationId": "Me.Trips.ListPlanItems",
"parameters": [
+ {
+ "name": "TripId",
+ "in": "path",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "schema": {
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "type": "integer",
+ "format": "int32"
+ },
+ "x-ms-docs-key-type": "Trip"
+ },
{
"$ref": "#/components/parameters/top"
},
@@ -1836,41 +1849,73 @@
"type": "array",
"items": {
"enum": [
- "TripId",
- "TripId desc",
- "ShareId",
- "ShareId desc",
- "Name",
- "Name desc",
- "Budget",
- "Budget desc",
- "Description",
- "Description desc",
- "Tags",
- "Tags desc",
+ "PlanItemId",
+ "PlanItemId desc",
+ "ConfirmationCode",
+ "ConfirmationCode desc",
"StartsAt",
"StartsAt desc",
"EndsAt",
- "EndsAt desc"
+ "EndsAt desc",
+ "Duration",
+ "Duration desc"
],
"type": "string"
}
}
- }
- ],
- "responses": {
- "200": {
- "description": "Retrieved navigation property links",
+ },
+ {
+ "name": "$select",
+ "in": "query",
+ "description": "Select properties to be returned",
+ "style": "form",
+ "explode": false,
+ "schema": {
+ "uniqueItems": true,
+ "type": "array",
+ "items": {
+ "enum": [
+ "PlanItemId",
+ "ConfirmationCode",
+ "StartsAt",
+ "EndsAt",
+ "Duration"
+ ],
+ "type": "string"
+ }
+ }
+ },
+ {
+ "name": "$expand",
+ "in": "query",
+ "description": "Expand related entities",
+ "style": "form",
+ "explode": false,
+ "schema": {
+ "uniqueItems": true,
+ "type": "array",
+ "items": {
+ "enum": [
+ "*"
+ ],
+ "type": "string"
+ }
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Retrieved navigation property",
"content": {
"application/json": {
"schema": {
- "title": "Collection of links of Trip",
+ "title": "Collection of PlanItem",
"type": "object",
"properties": {
"value": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem"
}
}
}
@@ -1883,31 +1928,87 @@
}
},
"x-ms-docs-operation-type": "operation"
- },
- "post": {
+ }
+ },
+ "/Me/Trips/{TripId}/PlanItems/$ref": {
+ "get": {
"tags": [
- "Me.Trip"
+ "Me.Trips.PlanItem"
],
- "summary": "Create new navigation property ref to Trips for Me",
- "operationId": "Me.CreateRefTrips",
- "requestBody": {
- "description": "New navigation property ref value",
- "content": {
- "application/json": {
- "schema": {
- "type": "String"
+ "summary": "Get ref of PlanItems from Me",
+ "operationId": "Me.Trips.ListRefPlanItems",
+ "parameters": [
+ {
+ "name": "TripId",
+ "in": "path",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "schema": {
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "type": "integer",
+ "format": "int32"
+ },
+ "x-ms-docs-key-type": "Trip"
+ },
+ {
+ "$ref": "#/components/parameters/top"
+ },
+ {
+ "$ref": "#/components/parameters/skip"
+ },
+ {
+ "$ref": "#/components/parameters/search"
+ },
+ {
+ "$ref": "#/components/parameters/filter"
+ },
+ {
+ "$ref": "#/components/parameters/count"
+ },
+ {
+ "name": "$orderby",
+ "in": "query",
+ "description": "Order items by property values",
+ "style": "form",
+ "explode": false,
+ "schema": {
+ "uniqueItems": true,
+ "type": "array",
+ "items": {
+ "enum": [
+ "PlanItemId",
+ "PlanItemId desc",
+ "ConfirmationCode",
+ "ConfirmationCode desc",
+ "StartsAt",
+ "StartsAt desc",
+ "EndsAt",
+ "EndsAt desc",
+ "Duration",
+ "Duration desc"
+ ],
+ "type": "string"
}
}
- },
- "required": true
- },
+ }
+ ],
"responses": {
- "201": {
- "description": "Created navigation property link.",
+ "200": {
+ "description": "Retrieved navigation property links",
"content": {
"application/json": {
"schema": {
- "type": "String"
+ "title": "Collection of links of PlanItem",
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
}
}
}
@@ -1918,33 +2019,51 @@
},
"x-ms-docs-operation-type": "operation"
},
- "delete": {
+ "post": {
"tags": [
- "Me.Trip"
+ "Me.Trips.PlanItem"
],
- "summary": "Delete ref of navigation property Trips for Me",
- "operationId": "Me.DeleteRefTrips",
+ "summary": "Create new navigation property ref to PlanItems for Me",
+ "operationId": "Me.Trips.CreateRefPlanItems",
"parameters": [
{
- "name": "If-Match",
- "in": "header",
- "description": "ETag",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "@id",
- "in": "query",
- "description": "Delete Uri",
+ "name": "TripId",
+ "in": "path",
+ "description": "key: TripId of Trip",
+ "required": true,
"schema": {
- "type": "string"
- }
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "type": "integer",
+ "format": "int32"
+ },
+ "x-ms-docs-key-type": "Trip"
}
],
+ "requestBody": {
+ "description": "New navigation property ref value",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
- "204": {
- "description": "Success"
+ "201": {
+ "description": "Created navigation property link.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object"
+ }
+ }
+ }
},
"default": {
"$ref": "#/components/responses/error"
@@ -2410,7 +2529,7 @@
},
"x-ms-docs-operation-type": "operation"
},
- "patch": {
+ "put": {
"tags": [
"NewComePeople.Person"
],
@@ -2433,7 +2552,10 @@
"content": {
"application/json": {
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
},
@@ -2635,13 +2757,13 @@
"x-ms-docs-operation-type": "operation"
}
},
- "/NewComePeople/{UserName}/Friends/{UserName1}": {
+ "/NewComePeople/{UserName}/Friends/$ref": {
"get": {
"tags": [
"NewComePeople.Person"
],
- "summary": "Get Friends from NewComePeople",
- "operationId": "NewComePeople.GetFriends",
+ "summary": "Get ref of Friends from NewComePeople",
+ "operationId": "NewComePeople.ListRefFriends",
"parameters": [
{
"name": "UserName",
@@ -2654,19 +2776,24 @@
"x-ms-docs-key-type": "Person"
},
{
- "name": "UserName1",
- "in": "path",
- "description": "key: UserName of Person",
- "required": true,
- "schema": {
- "type": "string"
- },
- "x-ms-docs-key-type": "Person"
+ "$ref": "#/components/parameters/top"
},
{
- "name": "$select",
+ "$ref": "#/components/parameters/skip"
+ },
+ {
+ "$ref": "#/components/parameters/search"
+ },
+ {
+ "$ref": "#/components/parameters/filter"
+ },
+ {
+ "$ref": "#/components/parameters/count"
+ },
+ {
+ "name": "$orderby",
"in": "query",
- "description": "Select properties to be returned",
+ "description": "Order items by property values",
"style": "form",
"explode": false,
"schema": {
@@ -2675,39 +2802,27 @@
"items": {
"enum": [
"UserName",
+ "UserName desc",
"FirstName",
+ "FirstName desc",
"LastName",
+ "LastName desc",
"MiddleName",
+ "MiddleName desc",
"Gender",
+ "Gender desc",
"Age",
+ "Age desc",
"Emails",
+ "Emails desc",
"AddressInfo",
+ "AddressInfo desc",
"HomeAddress",
+ "HomeAddress desc",
"FavoriteFeature",
+ "FavoriteFeature desc",
"Features",
- "Friends",
- "BestFriend",
- "Trips"
- ],
- "type": "string"
- }
- }
- },
- {
- "name": "$expand",
- "in": "query",
- "description": "Expand related entities",
- "style": "form",
- "explode": false,
- "schema": {
- "uniqueItems": true,
- "type": "array",
- "items": {
- "enum": [
- "*",
- "Friends",
- "BestFriend",
- "Trips"
+ "Features desc"
],
"type": "string"
}
@@ -2716,11 +2831,20 @@
],
"responses": {
"200": {
- "description": "Retrieved navigation property",
+ "description": "Retrieved navigation property links",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
+ "title": "Collection of links of Person",
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
}
}
}
@@ -2730,112 +2854,13 @@
}
},
"x-ms-docs-operation-type": "operation"
- }
- },
- "/NewComePeople/{UserName}/Friends/$ref": {
- "get": {
+ },
+ "post": {
"tags": [
"NewComePeople.Person"
],
- "summary": "Get ref of Friends from NewComePeople",
- "operationId": "NewComePeople.ListRefFriends",
- "parameters": [
- {
- "name": "UserName",
- "in": "path",
- "description": "key: UserName of Person",
- "required": true,
- "schema": {
- "type": "string"
- },
- "x-ms-docs-key-type": "Person"
- },
- {
- "$ref": "#/components/parameters/top"
- },
- {
- "$ref": "#/components/parameters/skip"
- },
- {
- "$ref": "#/components/parameters/search"
- },
- {
- "$ref": "#/components/parameters/filter"
- },
- {
- "$ref": "#/components/parameters/count"
- },
- {
- "name": "$orderby",
- "in": "query",
- "description": "Order items by property values",
- "style": "form",
- "explode": false,
- "schema": {
- "uniqueItems": true,
- "type": "array",
- "items": {
- "enum": [
- "UserName",
- "UserName desc",
- "FirstName",
- "FirstName desc",
- "LastName",
- "LastName desc",
- "MiddleName",
- "MiddleName desc",
- "Gender",
- "Gender desc",
- "Age",
- "Age desc",
- "Emails",
- "Emails desc",
- "AddressInfo",
- "AddressInfo desc",
- "HomeAddress",
- "HomeAddress desc",
- "FavoriteFeature",
- "FavoriteFeature desc",
- "Features",
- "Features desc"
- ],
- "type": "string"
- }
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Retrieved navigation property links",
- "content": {
- "application/json": {
- "schema": {
- "title": "Collection of links of Person",
- "type": "object",
- "properties": {
- "value": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- },
- "default": {
- "$ref": "#/components/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
- },
- "post": {
- "tags": [
- "NewComePeople.Person"
- ],
- "summary": "Create new navigation property ref to Friends for NewComePeople",
- "operationId": "NewComePeople.CreateRefFriends",
+ "summary": "Create new navigation property ref to Friends for NewComePeople",
+ "operationId": "NewComePeople.CreateRefFriends",
"parameters": [
{
"name": "UserName",
@@ -2853,7 +2878,10 @@
"content": {
"application/json": {
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
},
@@ -2865,7 +2893,7 @@
"content": {
"application/json": {
"schema": {
- "type": "String"
+ "type": "object"
}
}
}
@@ -2875,50 +2903,6 @@
}
},
"x-ms-docs-operation-type": "operation"
- },
- "delete": {
- "tags": [
- "NewComePeople.Person"
- ],
- "summary": "Delete ref of navigation property Friends for NewComePeople",
- "operationId": "NewComePeople.DeleteRefFriends",
- "parameters": [
- {
- "name": "UserName",
- "in": "path",
- "description": "key: UserName of Person",
- "required": true,
- "schema": {
- "type": "string"
- },
- "x-ms-docs-key-type": "Person"
- },
- {
- "name": "If-Match",
- "in": "header",
- "description": "ETag",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "@id",
- "in": "query",
- "description": "Delete Uri",
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "204": {
- "description": "Success"
- },
- "default": {
- "$ref": "#/components/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
}
},
"/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": {
@@ -3315,6 +3299,52 @@
}
},
"x-ms-docs-operation-type": "operation"
+ },
+ "post": {
+ "tags": [
+ "NewComePeople.Trip"
+ ],
+ "summary": "Create new navigation property to Trips for NewComePeople",
+ "operationId": "NewComePeople.CreateTrips",
+ "parameters": [
+ {
+ "name": "UserName",
+ "in": "path",
+ "description": "key: UserName of Person",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-docs-key-type": "Person"
+ }
+ ],
+ "requestBody": {
+ "description": "New navigation property",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "201": {
+ "description": "Created navigation property.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ }
+ }
+ }
+ },
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "operation"
}
},
"/NewComePeople/{UserName}/Trips/{TripId}": {
@@ -3408,15 +3438,13 @@
}
},
"x-ms-docs-operation-type": "operation"
- }
- },
- "/NewComePeople/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": {
- "get": {
+ },
+ "patch": {
"tags": [
- "NewComePeople.Functions"
+ "NewComePeople.Trip"
],
- "summary": "Invoke function GetInvolvedPeople",
- "operationId": "NewComePeople.Trips.GetInvolvedPeople",
+ "summary": "Update the navigation property Trips in NewComePeople",
+ "operationId": "NewComePeople.UpdateTrips",
"parameters": [
{
"name": "UserName",
@@ -3442,39 +3470,33 @@
"x-ms-docs-key-type": "Trip"
}
],
- "responses": {
- "200": {
- "description": "Success",
- "content": {
- "application/json": {
- "schema": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
- }
- ],
- "nullable": true
- }
- }
+ "requestBody": {
+ "description": "New navigation property values",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
}
}
},
+ "required": true
+ },
+ "responses": {
+ "204": {
+ "description": "Success"
+ },
"default": {
"$ref": "#/components/responses/error"
}
},
- "x-ms-docs-operation-type": "function"
- }
- },
- "/NewComePeople/{UserName}/Trips/$ref": {
- "get": {
+ "x-ms-docs-operation-type": "operation"
+ },
+ "delete": {
"tags": [
"NewComePeople.Trip"
],
- "summary": "Get ref of Trips from NewComePeople",
- "operationId": "NewComePeople.ListRefTrips",
+ "summary": "Delete navigation property Trips for NewComePeople",
+ "operationId": "NewComePeople.DeleteTrips",
"parameters": [
{
"name": "UserName",
@@ -3487,68 +3509,84 @@
"x-ms-docs-key-type": "Person"
},
{
- "$ref": "#/components/parameters/top"
+ "name": "TripId",
+ "in": "path",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "schema": {
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "type": "integer",
+ "format": "int32"
+ },
+ "x-ms-docs-key-type": "Trip"
},
{
- "$ref": "#/components/parameters/skip"
+ "name": "If-Match",
+ "in": "header",
+ "description": "ETag",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Success"
},
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "operation"
+ }
+ },
+ "/NewComePeople/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": {
+ "get": {
+ "tags": [
+ "NewComePeople.Functions"
+ ],
+ "summary": "Invoke function GetInvolvedPeople",
+ "operationId": "NewComePeople.Trips.GetInvolvedPeople",
+ "parameters": [
{
- "$ref": "#/components/parameters/search"
- },
- {
- "$ref": "#/components/parameters/filter"
- },
- {
- "$ref": "#/components/parameters/count"
+ "name": "UserName",
+ "in": "path",
+ "description": "key: UserName of Person",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-docs-key-type": "Person"
},
{
- "name": "$orderby",
- "in": "query",
- "description": "Order items by property values",
- "style": "form",
- "explode": false,
+ "name": "TripId",
+ "in": "path",
+ "description": "key: TripId of Trip",
+ "required": true,
"schema": {
- "uniqueItems": true,
- "type": "array",
- "items": {
- "enum": [
- "TripId",
- "TripId desc",
- "ShareId",
- "ShareId desc",
- "Name",
- "Name desc",
- "Budget",
- "Budget desc",
- "Description",
- "Description desc",
- "Tags",
- "Tags desc",
- "StartsAt",
- "StartsAt desc",
- "EndsAt",
- "EndsAt desc"
- ],
- "type": "string"
- }
- }
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "type": "integer",
+ "format": "int32"
+ },
+ "x-ms-docs-key-type": "Trip"
}
],
"responses": {
"200": {
- "description": "Retrieved navigation property links",
+ "description": "Success",
"content": {
"application/json": {
"schema": {
- "title": "Collection of links of Trip",
- "type": "object",
- "properties": {
- "value": {
- "type": "array",
- "items": {
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
}
- }
+ ],
+ "nullable": true
}
}
}
@@ -3558,14 +3596,16 @@
"$ref": "#/components/responses/error"
}
},
- "x-ms-docs-operation-type": "operation"
- },
- "post": {
+ "x-ms-docs-operation-type": "function"
+ }
+ },
+ "/NewComePeople/{UserName}/Trips/{TripId}/PlanItems": {
+ "get": {
"tags": [
- "NewComePeople.Trip"
+ "NewComePeople.Trips.PlanItem"
],
- "summary": "Create new navigation property ref to Trips for NewComePeople",
- "operationId": "NewComePeople.CreateRefTrips",
+ "summary": "Get PlanItems from NewComePeople",
+ "operationId": "NewComePeople.Trips.ListPlanItems",
"parameters": [
{
"name": "UserName",
@@ -3576,89 +3616,20 @@
"type": "string"
},
"x-ms-docs-key-type": "Person"
- }
- ],
- "requestBody": {
- "description": "New navigation property ref value",
- "content": {
- "application/json": {
- "schema": {
- "type": "String"
- }
- }
- },
- "required": true
- },
- "responses": {
- "201": {
- "description": "Created navigation property link.",
- "content": {
- "application/json": {
- "schema": {
- "type": "String"
- }
- }
- }
},
- "default": {
- "$ref": "#/components/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
- },
- "delete": {
- "tags": [
- "NewComePeople.Trip"
- ],
- "summary": "Delete ref of navigation property Trips for NewComePeople",
- "operationId": "NewComePeople.DeleteRefTrips",
- "parameters": [
{
- "name": "UserName",
+ "name": "TripId",
"in": "path",
- "description": "key: UserName of Person",
+ "description": "key: TripId of Trip",
"required": true,
"schema": {
- "type": "string"
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "type": "integer",
+ "format": "int32"
},
- "x-ms-docs-key-type": "Person"
- },
- {
- "name": "If-Match",
- "in": "header",
- "description": "ETag",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "@id",
- "in": "query",
- "description": "Delete Uri",
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "204": {
- "description": "Success"
+ "x-ms-docs-key-type": "Trip"
},
- "default": {
- "$ref": "#/components/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
- }
- },
- "/People": {
- "get": {
- "tags": [
- "People.Person"
- ],
- "summary": "Get entities from People",
- "operationId": "People.Person.ListPerson",
- "parameters": [
{
"$ref": "#/components/parameters/top"
},
@@ -3685,28 +3656,16 @@
"type": "array",
"items": {
"enum": [
- "UserName",
- "UserName desc",
- "FirstName",
- "FirstName desc",
- "LastName",
- "LastName desc",
- "MiddleName",
- "MiddleName desc",
- "Gender",
- "Gender desc",
- "Age",
- "Age desc",
- "Emails",
- "Emails desc",
- "AddressInfo",
- "AddressInfo desc",
- "HomeAddress",
- "HomeAddress desc",
- "FavoriteFeature",
- "FavoriteFeature desc",
- "Features",
- "Features desc"
+ "PlanItemId",
+ "PlanItemId desc",
+ "ConfirmationCode",
+ "ConfirmationCode desc",
+ "StartsAt",
+ "StartsAt desc",
+ "EndsAt",
+ "EndsAt desc",
+ "Duration",
+ "Duration desc"
],
"type": "string"
}
@@ -3723,20 +3682,11 @@
"type": "array",
"items": {
"enum": [
- "UserName",
- "FirstName",
- "LastName",
- "MiddleName",
- "Gender",
- "Age",
- "Emails",
- "AddressInfo",
- "HomeAddress",
- "FavoriteFeature",
- "Features",
- "Friends",
- "BestFriend",
- "Trips"
+ "PlanItemId",
+ "ConfirmationCode",
+ "StartsAt",
+ "EndsAt",
+ "Duration"
],
"type": "string"
}
@@ -3753,10 +3703,7 @@
"type": "array",
"items": {
"enum": [
- "*",
- "Friends",
- "BestFriend",
- "Trips"
+ "*"
],
"type": "string"
}
@@ -3765,17 +3712,17 @@
],
"responses": {
"200": {
- "description": "Retrieved entities",
+ "description": "Retrieved navigation property",
"content": {
"application/json": {
"schema": {
- "title": "Collection of Person",
+ "title": "Collection of PlanItem",
"type": "object",
"properties": {
"value": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem"
}
}
}
@@ -3786,50 +3733,17 @@
"default": {
"$ref": "#/components/responses/error"
}
- }
- },
- "post": {
- "tags": [
- "People.Person"
- ],
- "summary": "Add new entity to People",
- "operationId": "People.Person.CreatePerson",
- "requestBody": {
- "description": "New entity",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
- }
- }
- },
- "required": true
- },
- "responses": {
- "201": {
- "description": "Created entity",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
- }
- }
- }
- },
- "default": {
- "$ref": "#/components/responses/error"
- }
},
"x-ms-docs-operation-type": "operation"
}
},
- "/People/{UserName}": {
+ "/NewComePeople/{UserName}/Trips/{TripId}/PlanItems/$ref": {
"get": {
"tags": [
- "People.Person"
+ "NewComePeople.Trips.PlanItem"
],
- "summary": "Get entity from People by key",
- "operationId": "People.Person.GetPerson",
+ "summary": "Get ref of PlanItems from NewComePeople",
+ "operationId": "NewComePeople.Trips.ListRefPlanItems",
"parameters": [
{
"name": "UserName",
@@ -3842,39 +3756,37 @@
"x-ms-docs-key-type": "Person"
},
{
- "name": "$select",
- "in": "query",
- "description": "Select properties to be returned",
- "style": "form",
- "explode": false,
+ "name": "TripId",
+ "in": "path",
+ "description": "key: TripId of Trip",
+ "required": true,
"schema": {
- "uniqueItems": true,
- "type": "array",
- "items": {
- "enum": [
- "UserName",
- "FirstName",
- "LastName",
- "MiddleName",
- "Gender",
- "Age",
- "Emails",
- "AddressInfo",
- "HomeAddress",
- "FavoriteFeature",
- "Features",
- "Friends",
- "BestFriend",
- "Trips"
- ],
- "type": "string"
- }
- }
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "type": "integer",
+ "format": "int32"
+ },
+ "x-ms-docs-key-type": "Trip"
},
{
- "name": "$expand",
+ "$ref": "#/components/parameters/top"
+ },
+ {
+ "$ref": "#/components/parameters/skip"
+ },
+ {
+ "$ref": "#/components/parameters/search"
+ },
+ {
+ "$ref": "#/components/parameters/filter"
+ },
+ {
+ "$ref": "#/components/parameters/count"
+ },
+ {
+ "name": "$orderby",
"in": "query",
- "description": "Expand related entities",
+ "description": "Order items by property values",
"style": "form",
"explode": false,
"schema": {
@@ -3882,10 +3794,16 @@
"type": "array",
"items": {
"enum": [
- "*",
- "Friends",
- "BestFriend",
- "Trips"
+ "PlanItemId",
+ "PlanItemId desc",
+ "ConfirmationCode",
+ "ConfirmationCode desc",
+ "StartsAt",
+ "StartsAt desc",
+ "EndsAt",
+ "EndsAt desc",
+ "Duration",
+ "Duration desc"
],
"type": "string"
}
@@ -3894,11 +3812,20 @@
],
"responses": {
"200": {
- "description": "Retrieved entity",
+ "description": "Retrieved navigation property links",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
+ "title": "Collection of links of PlanItem",
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
}
}
}
@@ -3909,12 +3836,12 @@
},
"x-ms-docs-operation-type": "operation"
},
- "patch": {
+ "post": {
"tags": [
- "People.Person"
+ "NewComePeople.Trips.PlanItem"
],
- "summary": "Update entity in People",
- "operationId": "People.Person.UpdatePerson",
+ "summary": "Create new navigation property ref to PlanItems for NewComePeople",
+ "operationId": "NewComePeople.Trips.CreateRefPlanItems",
"parameters": [
{
"name": "UserName",
@@ -3925,58 +3852,45 @@
"type": "string"
},
"x-ms-docs-key-type": "Person"
+ },
+ {
+ "name": "TripId",
+ "in": "path",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "schema": {
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "type": "integer",
+ "format": "int32"
+ },
+ "x-ms-docs-key-type": "Trip"
}
],
"requestBody": {
- "description": "New property values",
+ "description": "New navigation property ref value",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
},
"required": true
},
"responses": {
- "204": {
- "description": "Success"
- },
- "default": {
- "$ref": "#/components/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
- },
- "delete": {
- "tags": [
- "People.Person"
- ],
- "summary": "Delete entity from People",
- "operationId": "People.Person.DeletePerson",
- "parameters": [
- {
- "name": "UserName",
- "in": "path",
- "description": "key: UserName of Person",
- "required": true,
- "schema": {
- "type": "string"
- },
- "x-ms-docs-key-type": "Person"
- },
- {
- "name": "If-Match",
- "in": "header",
- "description": "ETag",
- "schema": {
- "type": "string"
+ "201": {
+ "description": "Created navigation property link.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object"
+ }
+ }
}
- }
- ],
- "responses": {
- "204": {
- "description": "Success"
},
"default": {
"$ref": "#/components/responses/error"
@@ -3985,23 +3899,66 @@
"x-ms-docs-operation-type": "operation"
}
},
- "/People/{UserName}/BestFriend": {
+ "/People": {
"get": {
"tags": [
"People.Person"
],
- "summary": "Get BestFriend from People",
- "operationId": "People.GetBestFriend",
+ "summary": "Get entities from People",
+ "operationId": "People.Person.ListPerson",
"parameters": [
{
- "name": "UserName",
- "in": "path",
- "description": "key: UserName of Person",
- "required": true,
+ "$ref": "#/components/parameters/top"
+ },
+ {
+ "$ref": "#/components/parameters/skip"
+ },
+ {
+ "$ref": "#/components/parameters/search"
+ },
+ {
+ "$ref": "#/components/parameters/filter"
+ },
+ {
+ "$ref": "#/components/parameters/count"
+ },
+ {
+ "name": "$orderby",
+ "in": "query",
+ "description": "Order items by property values",
+ "style": "form",
+ "explode": false,
"schema": {
- "type": "string"
- },
- "x-ms-docs-key-type": "Person"
+ "uniqueItems": true,
+ "type": "array",
+ "items": {
+ "enum": [
+ "UserName",
+ "UserName desc",
+ "FirstName",
+ "FirstName desc",
+ "LastName",
+ "LastName desc",
+ "MiddleName",
+ "MiddleName desc",
+ "Gender",
+ "Gender desc",
+ "Age",
+ "Age desc",
+ "Emails",
+ "Emails desc",
+ "AddressInfo",
+ "AddressInfo desc",
+ "HomeAddress",
+ "HomeAddress desc",
+ "FavoriteFeature",
+ "FavoriteFeature desc",
+ "Features",
+ "Features desc"
+ ],
+ "type": "string"
+ }
+ }
},
{
"name": "$select",
@@ -4056,11 +4013,20 @@
],
"responses": {
"200": {
- "description": "Retrieved navigation property",
+ "description": "Retrieved entities",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
+ "title": "Collection of Person",
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
+ }
+ }
+ }
}
}
}
@@ -4068,36 +4034,32 @@
"default": {
"$ref": "#/components/responses/error"
}
- },
- "x-ms-docs-operation-type": "operation"
- }
- },
- "/People/{UserName}/BestFriend/$ref": {
- "get": {
+ }
+ },
+ "post": {
"tags": [
"People.Person"
],
- "summary": "Get ref of BestFriend from People",
- "operationId": "People.GetRefBestFriend",
- "parameters": [
- {
- "name": "UserName",
- "in": "path",
- "description": "key: UserName of Person",
- "required": true,
- "schema": {
- "type": "string"
- },
- "x-ms-docs-key-type": "Person"
- }
- ],
+ "summary": "Add new entity to People",
+ "operationId": "People.Person.CreatePerson",
+ "requestBody": {
+ "description": "New entity",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
- "200": {
- "description": "Retrieved navigation property link",
+ "201": {
+ "description": "Created entity",
"content": {
"application/json": {
"schema": {
- "type": "string"
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
}
}
}
@@ -4107,13 +4069,15 @@
}
},
"x-ms-docs-operation-type": "operation"
- },
- "patch": {
+ }
+ },
+ "/People/{UserName}": {
+ "get": {
"tags": [
"People.Person"
],
- "summary": "Update the ref of navigation property BestFriend in People",
- "operationId": "People.UpdateRefBestFriend",
+ "summary": "Get entity from People by key",
+ "operationId": "People.Person.GetPerson",
"parameters": [
{
"name": "UserName",
@@ -4124,14 +4088,99 @@
"type": "string"
},
"x-ms-docs-key-type": "Person"
- }
+ },
+ {
+ "name": "$select",
+ "in": "query",
+ "description": "Select properties to be returned",
+ "style": "form",
+ "explode": false,
+ "schema": {
+ "uniqueItems": true,
+ "type": "array",
+ "items": {
+ "enum": [
+ "UserName",
+ "FirstName",
+ "LastName",
+ "MiddleName",
+ "Gender",
+ "Age",
+ "Emails",
+ "AddressInfo",
+ "HomeAddress",
+ "FavoriteFeature",
+ "Features",
+ "Friends",
+ "BestFriend",
+ "Trips"
+ ],
+ "type": "string"
+ }
+ }
+ },
+ {
+ "name": "$expand",
+ "in": "query",
+ "description": "Expand related entities",
+ "style": "form",
+ "explode": false,
+ "schema": {
+ "uniqueItems": true,
+ "type": "array",
+ "items": {
+ "enum": [
+ "*",
+ "Friends",
+ "BestFriend",
+ "Trips"
+ ],
+ "type": "string"
+ }
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Retrieved entity",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
+ }
+ }
+ }
+ },
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "operation"
+ },
+ "patch": {
+ "tags": [
+ "People.Person"
+ ],
+ "summary": "Update entity in People",
+ "operationId": "People.Person.UpdatePerson",
+ "parameters": [
+ {
+ "name": "UserName",
+ "in": "path",
+ "description": "key: UserName of Person",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-docs-key-type": "Person"
+ }
],
"requestBody": {
- "description": "New navigation property ref values",
+ "description": "New property values",
"content": {
"application/json": {
"schema": {
- "type": "String"
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
}
}
},
@@ -4151,8 +4200,8 @@
"tags": [
"People.Person"
],
- "summary": "Delete ref of navigation property BestFriend for People",
- "operationId": "People.DeleteRefBestFriend",
+ "summary": "Delete entity from People",
+ "operationId": "People.Person.DeletePerson",
"parameters": [
{
"name": "UserName",
@@ -4184,13 +4233,13 @@
"x-ms-docs-operation-type": "operation"
}
},
- "/People/{UserName}/Friends": {
+ "/People/{UserName}/BestFriend": {
"get": {
"tags": [
"People.Person"
],
- "summary": "Get Friends from People",
- "operationId": "People.ListFriends",
+ "summary": "Get BestFriend from People",
+ "operationId": "People.GetBestFriend",
"parameters": [
{
"name": "UserName",
@@ -4202,59 +4251,6 @@
},
"x-ms-docs-key-type": "Person"
},
- {
- "$ref": "#/components/parameters/top"
- },
- {
- "$ref": "#/components/parameters/skip"
- },
- {
- "$ref": "#/components/parameters/search"
- },
- {
- "$ref": "#/components/parameters/filter"
- },
- {
- "$ref": "#/components/parameters/count"
- },
- {
- "name": "$orderby",
- "in": "query",
- "description": "Order items by property values",
- "style": "form",
- "explode": false,
- "schema": {
- "uniqueItems": true,
- "type": "array",
- "items": {
- "enum": [
- "UserName",
- "UserName desc",
- "FirstName",
- "FirstName desc",
- "LastName",
- "LastName desc",
- "MiddleName",
- "MiddleName desc",
- "Gender",
- "Gender desc",
- "Age",
- "Age desc",
- "Emails",
- "Emails desc",
- "AddressInfo",
- "AddressInfo desc",
- "HomeAddress",
- "HomeAddress desc",
- "FavoriteFeature",
- "FavoriteFeature desc",
- "Features",
- "Features desc"
- ],
- "type": "string"
- }
- }
- },
{
"name": "$select",
"in": "query",
@@ -4312,16 +4308,7 @@
"content": {
"application/json": {
"schema": {
- "title": "Collection of Person",
- "type": "object",
- "properties": {
- "value": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
- }
- }
- }
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
}
}
}
@@ -4333,13 +4320,13 @@
"x-ms-docs-operation-type": "operation"
}
},
- "/People/{UserName}/Friends/{UserName1}": {
+ "/People/{UserName}/BestFriend/$ref": {
"get": {
"tags": [
"People.Person"
],
- "summary": "Get Friends from People",
- "operationId": "People.GetFriends",
+ "summary": "Get ref of BestFriend from People",
+ "operationId": "People.GetRefBestFriend",
"parameters": [
{
"name": "UserName",
@@ -4350,75 +4337,15 @@
"type": "string"
},
"x-ms-docs-key-type": "Person"
- },
- {
- "name": "UserName1",
- "in": "path",
- "description": "key: UserName of Person",
- "required": true,
- "schema": {
- "type": "string"
- },
- "x-ms-docs-key-type": "Person"
- },
- {
- "name": "$select",
- "in": "query",
- "description": "Select properties to be returned",
- "style": "form",
- "explode": false,
- "schema": {
- "uniqueItems": true,
- "type": "array",
- "items": {
- "enum": [
- "UserName",
- "FirstName",
- "LastName",
- "MiddleName",
- "Gender",
- "Age",
- "Emails",
- "AddressInfo",
- "HomeAddress",
- "FavoriteFeature",
- "Features",
- "Friends",
- "BestFriend",
- "Trips"
- ],
- "type": "string"
- }
- }
- },
- {
- "name": "$expand",
- "in": "query",
- "description": "Expand related entities",
- "style": "form",
- "explode": false,
- "schema": {
- "uniqueItems": true,
- "type": "array",
- "items": {
- "enum": [
- "*",
- "Friends",
- "BestFriend",
- "Trips"
- ],
- "type": "string"
- }
- }
}
],
"responses": {
"200": {
- "description": "Retrieved navigation property",
+ "description": "Retrieved navigation property link",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
+ "type": "string"
}
}
}
@@ -4428,15 +4355,242 @@
}
},
"x-ms-docs-operation-type": "operation"
- }
- },
- "/People/{UserName}/Friends/$ref": {
- "get": {
+ },
+ "put": {
"tags": [
"People.Person"
],
- "summary": "Get ref of Friends from People",
- "operationId": "People.ListRefFriends",
+ "summary": "Update the ref of navigation property BestFriend in People",
+ "operationId": "People.UpdateRefBestFriend",
+ "parameters": [
+ {
+ "name": "UserName",
+ "in": "path",
+ "description": "key: UserName of Person",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-docs-key-type": "Person"
+ }
+ ],
+ "requestBody": {
+ "description": "New navigation property ref values",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "204": {
+ "description": "Success"
+ },
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "operation"
+ },
+ "delete": {
+ "tags": [
+ "People.Person"
+ ],
+ "summary": "Delete ref of navigation property BestFriend for People",
+ "operationId": "People.DeleteRefBestFriend",
+ "parameters": [
+ {
+ "name": "UserName",
+ "in": "path",
+ "description": "key: UserName of Person",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-docs-key-type": "Person"
+ },
+ {
+ "name": "If-Match",
+ "in": "header",
+ "description": "ETag",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Success"
+ },
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "operation"
+ }
+ },
+ "/People/{UserName}/Friends": {
+ "get": {
+ "tags": [
+ "People.Person"
+ ],
+ "summary": "Get Friends from People",
+ "operationId": "People.ListFriends",
+ "parameters": [
+ {
+ "name": "UserName",
+ "in": "path",
+ "description": "key: UserName of Person",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-docs-key-type": "Person"
+ },
+ {
+ "$ref": "#/components/parameters/top"
+ },
+ {
+ "$ref": "#/components/parameters/skip"
+ },
+ {
+ "$ref": "#/components/parameters/search"
+ },
+ {
+ "$ref": "#/components/parameters/filter"
+ },
+ {
+ "$ref": "#/components/parameters/count"
+ },
+ {
+ "name": "$orderby",
+ "in": "query",
+ "description": "Order items by property values",
+ "style": "form",
+ "explode": false,
+ "schema": {
+ "uniqueItems": true,
+ "type": "array",
+ "items": {
+ "enum": [
+ "UserName",
+ "UserName desc",
+ "FirstName",
+ "FirstName desc",
+ "LastName",
+ "LastName desc",
+ "MiddleName",
+ "MiddleName desc",
+ "Gender",
+ "Gender desc",
+ "Age",
+ "Age desc",
+ "Emails",
+ "Emails desc",
+ "AddressInfo",
+ "AddressInfo desc",
+ "HomeAddress",
+ "HomeAddress desc",
+ "FavoriteFeature",
+ "FavoriteFeature desc",
+ "Features",
+ "Features desc"
+ ],
+ "type": "string"
+ }
+ }
+ },
+ {
+ "name": "$select",
+ "in": "query",
+ "description": "Select properties to be returned",
+ "style": "form",
+ "explode": false,
+ "schema": {
+ "uniqueItems": true,
+ "type": "array",
+ "items": {
+ "enum": [
+ "UserName",
+ "FirstName",
+ "LastName",
+ "MiddleName",
+ "Gender",
+ "Age",
+ "Emails",
+ "AddressInfo",
+ "HomeAddress",
+ "FavoriteFeature",
+ "Features",
+ "Friends",
+ "BestFriend",
+ "Trips"
+ ],
+ "type": "string"
+ }
+ }
+ },
+ {
+ "name": "$expand",
+ "in": "query",
+ "description": "Expand related entities",
+ "style": "form",
+ "explode": false,
+ "schema": {
+ "uniqueItems": true,
+ "type": "array",
+ "items": {
+ "enum": [
+ "*",
+ "Friends",
+ "BestFriend",
+ "Trips"
+ ],
+ "type": "string"
+ }
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Retrieved navigation property",
+ "content": {
+ "application/json": {
+ "schema": {
+ "title": "Collection of Person",
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "operation"
+ }
+ },
+ "/People/{UserName}/Friends/$ref": {
+ "get": {
+ "tags": [
+ "People.Person"
+ ],
+ "summary": "Get ref of Friends from People",
+ "operationId": "People.ListRefFriends",
"parameters": [
{
"name": "UserName",
@@ -4449,12 +4603,12 @@
"x-ms-docs-key-type": "Person"
},
{
- "$ref": "#/components/parameters/top"
- },
- {
- "$ref": "#/components/parameters/skip"
- },
- {
+ "$ref": "#/components/parameters/top"
+ },
+ {
+ "$ref": "#/components/parameters/skip"
+ },
+ {
"$ref": "#/components/parameters/search"
},
{
@@ -4551,7 +4705,10 @@
"content": {
"application/json": {
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
},
@@ -4563,7 +4720,7 @@
"content": {
"application/json": {
"schema": {
- "type": "String"
+ "type": "object"
}
}
}
@@ -4573,13 +4730,15 @@
}
},
"x-ms-docs-operation-type": "operation"
- },
- "delete": {
+ }
+ },
+ "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": {
+ "get": {
"tags": [
- "People.Person"
+ "People.Functions"
],
- "summary": "Delete ref of navigation property Friends for People",
- "operationId": "People.DeleteRefFriends",
+ "summary": "Invoke function GetFavoriteAirline",
+ "operationId": "People.GetFavoriteAirline",
"parameters": [
{
"name": "UserName",
@@ -4590,42 +4749,390 @@
"type": "string"
},
"x-ms-docs-key-type": "Person"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Airline"
+ }
+ ],
+ "nullable": true
+ }
+ }
+ }
},
- {
- "name": "If-Match",
- "in": "header",
- "description": "ETag",
- "schema": {
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "function"
+ }
+ },
+ "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName={userName})": {
+ "get": {
+ "tags": [
+ "People.Functions"
+ ],
+ "summary": "Invoke function GetFriendsTrips",
+ "operationId": "People.GetFriendsTrips",
+ "parameters": [
+ {
+ "name": "UserName",
+ "in": "path",
+ "description": "key: UserName of Person",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-docs-key-type": "Person"
+ },
+ {
+ "name": "userName",
+ "in": "path",
+ "required": true,
+ "schema": {
"type": "string"
}
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ }
+ ],
+ "nullable": true
+ }
+ }
+ }
+ }
},
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "function"
+ }
+ },
+ "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetPeersForTrip": {
+ "post": {
+ "tags": [
+ "People.Actions"
+ ],
+ "summary": "Invoke action GetPeersForTrip",
+ "operationId": "People.GetPeersForTrip",
+ "parameters": [
{
- "name": "@id",
- "in": "query",
- "description": "Delete Uri",
+ "name": "UserName",
+ "in": "path",
+ "description": "key: UserName of Person",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-docs-key-type": "Person"
+ }
+ ],
+ "requestBody": {
+ "description": "Action parameters",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "userName": {
+ "type": "string"
+ },
+ "tripId": {
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "type": "integer",
+ "format": "int32"
+ }
+ }
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
+ }
+ ],
+ "nullable": true
+ }
+ }
+ }
+ }
+ },
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "action"
+ }
+ },
+ "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.ShareTrip": {
+ "post": {
+ "tags": [
+ "People.Actions"
+ ],
+ "summary": "Invoke action ShareTrip",
+ "operationId": "People.ShareTrip",
+ "parameters": [
+ {
+ "name": "UserName",
+ "in": "path",
+ "description": "key: UserName of Person",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-docs-key-type": "Person"
+ }
+ ],
+ "requestBody": {
+ "description": "Action parameters",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "userName": {
+ "type": "string"
+ },
+ "tripId": {
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "type": "integer",
+ "format": "int32"
+ }
+ }
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "204": {
+ "description": "Success"
+ },
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "action"
+ }
+ },
+ "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName={lastName})": {
+ "get": {
+ "tags": [
+ "People.Functions"
+ ],
+ "summary": "Invoke function UpdatePersonLastName",
+ "operationId": "People.UpdatePersonLastName",
+ "parameters": [
+ {
+ "name": "UserName",
+ "in": "path",
+ "description": "key: UserName of Person",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-docs-key-type": "Person"
+ },
+ {
+ "name": "lastName",
+ "in": "path",
+ "required": true,
"schema": {
"type": "string"
}
- }
- ],
- "responses": {
- "204": {
- "description": "Success"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "boolean",
+ "default": false
+ }
+ }
+ }
+ },
+ "default": {
+ "$ref": "#/components/responses/error"
+ }
+ },
+ "x-ms-docs-operation-type": "function"
+ }
+ },
+ "/People/{UserName}/Trips": {
+ "get": {
+ "tags": [
+ "People.Trip"
+ ],
+ "summary": "Get Trips from People",
+ "operationId": "People.ListTrips",
+ "parameters": [
+ {
+ "name": "UserName",
+ "in": "path",
+ "description": "key: UserName of Person",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-docs-key-type": "Person"
+ },
+ {
+ "$ref": "#/components/parameters/top"
+ },
+ {
+ "$ref": "#/components/parameters/skip"
+ },
+ {
+ "$ref": "#/components/parameters/search"
+ },
+ {
+ "$ref": "#/components/parameters/filter"
+ },
+ {
+ "$ref": "#/components/parameters/count"
+ },
+ {
+ "name": "$orderby",
+ "in": "query",
+ "description": "Order items by property values",
+ "style": "form",
+ "explode": false,
+ "schema": {
+ "uniqueItems": true,
+ "type": "array",
+ "items": {
+ "enum": [
+ "TripId",
+ "TripId desc",
+ "ShareId",
+ "ShareId desc",
+ "Name",
+ "Name desc",
+ "Budget",
+ "Budget desc",
+ "Description",
+ "Description desc",
+ "Tags",
+ "Tags desc",
+ "StartsAt",
+ "StartsAt desc",
+ "EndsAt",
+ "EndsAt desc"
+ ],
+ "type": "string"
+ }
+ }
+ },
+ {
+ "name": "$select",
+ "in": "query",
+ "description": "Select properties to be returned",
+ "style": "form",
+ "explode": false,
+ "schema": {
+ "uniqueItems": true,
+ "type": "array",
+ "items": {
+ "enum": [
+ "TripId",
+ "ShareId",
+ "Name",
+ "Budget",
+ "Description",
+ "Tags",
+ "StartsAt",
+ "EndsAt",
+ "PlanItems"
+ ],
+ "type": "string"
+ }
+ }
+ },
+ {
+ "name": "$expand",
+ "in": "query",
+ "description": "Expand related entities",
+ "style": "form",
+ "explode": false,
+ "schema": {
+ "uniqueItems": true,
+ "type": "array",
+ "items": {
+ "enum": [
+ "*",
+ "PlanItems"
+ ],
+ "type": "string"
+ }
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Retrieved navigation property",
+ "content": {
+ "application/json": {
+ "schema": {
+ "title": "Collection of Trip",
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ }
+ }
+ }
+ }
+ }
+ }
},
"default": {
"$ref": "#/components/responses/error"
}
},
"x-ms-docs-operation-type": "operation"
- }
- },
- "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": {
- "get": {
+ },
+ "post": {
"tags": [
- "People.Functions"
+ "People.Trip"
],
- "summary": "Invoke function GetFavoriteAirline",
- "operationId": "People.GetFavoriteAirline",
+ "summary": "Create new navigation property to Trips for People",
+ "operationId": "People.CreateTrips",
"parameters": [
{
"name": "UserName",
@@ -4638,18 +5145,24 @@
"x-ms-docs-key-type": "Person"
}
],
+ "requestBody": {
+ "description": "New navigation property",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
- "200": {
- "description": "Success",
+ "201": {
+ "description": "Created navigation property.",
"content": {
"application/json": {
"schema": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Airline"
- }
- ],
- "nullable": true
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
}
}
}
@@ -4658,16 +5171,16 @@
"$ref": "#/components/responses/error"
}
},
- "x-ms-docs-operation-type": "function"
+ "x-ms-docs-operation-type": "operation"
}
},
- "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName={userName})": {
+ "/People/{UserName}/Trips/{TripId}": {
"get": {
"tags": [
- "People.Functions"
+ "People.Trip"
],
- "summary": "Invoke function GetFriendsTrips",
- "operationId": "People.GetFriendsTrips",
+ "summary": "Get Trips from People",
+ "operationId": "People.GetTrips",
"parameters": [
{
"name": "UserName",
@@ -4680,29 +5193,69 @@
"x-ms-docs-key-type": "Person"
},
{
- "name": "userName",
+ "name": "TripId",
"in": "path",
+ "description": "key: TripId of Trip",
"required": true,
"schema": {
- "type": "string"
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "type": "integer",
+ "format": "int32"
+ },
+ "x-ms-docs-key-type": "Trip"
+ },
+ {
+ "name": "$select",
+ "in": "query",
+ "description": "Select properties to be returned",
+ "style": "form",
+ "explode": false,
+ "schema": {
+ "uniqueItems": true,
+ "type": "array",
+ "items": {
+ "enum": [
+ "TripId",
+ "ShareId",
+ "Name",
+ "Budget",
+ "Description",
+ "Tags",
+ "StartsAt",
+ "EndsAt",
+ "PlanItems"
+ ],
+ "type": "string"
+ }
+ }
+ },
+ {
+ "name": "$expand",
+ "in": "query",
+ "description": "Expand related entities",
+ "style": "form",
+ "explode": false,
+ "schema": {
+ "uniqueItems": true,
+ "type": "array",
+ "items": {
+ "enum": [
+ "*",
+ "PlanItems"
+ ],
+ "type": "string"
+ }
}
}
],
"responses": {
"200": {
- "description": "Success",
+ "description": "Retrieved navigation property",
"content": {
"application/json": {
"schema": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
- }
- ],
- "nullable": true
- }
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
}
}
}
@@ -4711,16 +5264,14 @@
"$ref": "#/components/responses/error"
}
},
- "x-ms-docs-operation-type": "function"
- }
- },
- "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetPeersForTrip": {
- "post": {
+ "x-ms-docs-operation-type": "operation"
+ },
+ "patch": {
"tags": [
- "People.Actions"
+ "People.Trip"
],
- "summary": "Invoke action GetPeersForTrip",
- "operationId": "People.GetPeersForTrip",
+ "summary": "Update the navigation property Trips in People",
+ "operationId": "People.UpdateTrips",
"parameters": [
{
"name": "UserName",
@@ -4731,63 +5282,48 @@
"type": "string"
},
"x-ms-docs-key-type": "Person"
+ },
+ {
+ "name": "TripId",
+ "in": "path",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "schema": {
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "type": "integer",
+ "format": "int32"
+ },
+ "x-ms-docs-key-type": "Trip"
}
],
"requestBody": {
- "description": "Action parameters",
+ "description": "New navigation property values",
"content": {
"application/json": {
"schema": {
- "type": "object",
- "properties": {
- "userName": {
- "type": "string"
- },
- "tripId": {
- "maximum": 2147483647,
- "minimum": -2147483648,
- "type": "integer",
- "format": "int32"
- }
- }
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
}
}
},
"required": true
},
"responses": {
- "200": {
- "description": "Success",
- "content": {
- "application/json": {
- "schema": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
- }
- ],
- "nullable": true
- }
- }
- }
- }
+ "204": {
+ "description": "Success"
},
"default": {
"$ref": "#/components/responses/error"
}
},
- "x-ms-docs-operation-type": "action"
- }
- },
- "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.ShareTrip": {
- "post": {
+ "x-ms-docs-operation-type": "operation"
+ },
+ "delete": {
"tags": [
- "People.Actions"
+ "People.Trip"
],
- "summary": "Invoke action ShareTrip",
- "operationId": "People.ShareTrip",
+ "summary": "Delete navigation property Trips for People",
+ "operationId": "People.DeleteTrips",
"parameters": [
{
"name": "UserName",
@@ -4798,30 +5334,29 @@
"type": "string"
},
"x-ms-docs-key-type": "Person"
+ },
+ {
+ "name": "TripId",
+ "in": "path",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "schema": {
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "type": "integer",
+ "format": "int32"
+ },
+ "x-ms-docs-key-type": "Trip"
+ },
+ {
+ "name": "If-Match",
+ "in": "header",
+ "description": "ETag",
+ "schema": {
+ "type": "string"
+ }
}
],
- "requestBody": {
- "description": "Action parameters",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "userName": {
- "type": "string"
- },
- "tripId": {
- "maximum": 2147483647,
- "minimum": -2147483648,
- "type": "integer",
- "format": "int32"
- }
- }
- }
- }
- },
- "required": true
- },
"responses": {
"204": {
"description": "Success"
@@ -4830,16 +5365,16 @@
"$ref": "#/components/responses/error"
}
},
- "x-ms-docs-operation-type": "action"
+ "x-ms-docs-operation-type": "operation"
}
},
- "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName={lastName})": {
+ "/People/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": {
"get": {
"tags": [
"People.Functions"
],
- "summary": "Invoke function UpdatePersonLastName",
- "operationId": "People.UpdatePersonLastName",
+ "summary": "Invoke function GetInvolvedPeople",
+ "operationId": "People.Trips.GetInvolvedPeople",
"parameters": [
{
"name": "UserName",
@@ -4852,12 +5387,17 @@
"x-ms-docs-key-type": "Person"
},
{
- "name": "lastName",
+ "name": "TripId",
"in": "path",
+ "description": "key: TripId of Trip",
"required": true,
"schema": {
- "type": "string"
- }
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "type": "integer",
+ "format": "int32"
+ },
+ "x-ms-docs-key-type": "Trip"
}
],
"responses": {
@@ -4866,8 +5406,15 @@
"content": {
"application/json": {
"schema": {
- "type": "boolean",
- "default": false
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
+ }
+ ],
+ "nullable": true
+ }
}
}
}
@@ -4879,13 +5426,13 @@
"x-ms-docs-operation-type": "function"
}
},
- "/People/{UserName}/Trips": {
+ "/People/{UserName}/Trips/{TripId}/PlanItems": {
"get": {
"tags": [
- "People.Trip"
- ],
- "summary": "Get Trips from People",
- "operationId": "People.ListTrips",
+ "People.Trips.PlanItem"
+ ],
+ "summary": "Get PlanItems from People",
+ "operationId": "People.Trips.ListPlanItems",
"parameters": [
{
"name": "UserName",
@@ -4897,6 +5444,19 @@
},
"x-ms-docs-key-type": "Person"
},
+ {
+ "name": "TripId",
+ "in": "path",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "schema": {
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "type": "integer",
+ "format": "int32"
+ },
+ "x-ms-docs-key-type": "Trip"
+ },
{
"$ref": "#/components/parameters/top"
},
@@ -4923,22 +5483,16 @@
"type": "array",
"items": {
"enum": [
- "TripId",
- "TripId desc",
- "ShareId",
- "ShareId desc",
- "Name",
- "Name desc",
- "Budget",
- "Budget desc",
- "Description",
- "Description desc",
- "Tags",
- "Tags desc",
+ "PlanItemId",
+ "PlanItemId desc",
+ "ConfirmationCode",
+ "ConfirmationCode desc",
"StartsAt",
"StartsAt desc",
"EndsAt",
- "EndsAt desc"
+ "EndsAt desc",
+ "Duration",
+ "Duration desc"
],
"type": "string"
}
@@ -4955,15 +5509,11 @@
"type": "array",
"items": {
"enum": [
- "TripId",
- "ShareId",
- "Name",
- "Budget",
- "Description",
- "Tags",
+ "PlanItemId",
+ "ConfirmationCode",
"StartsAt",
"EndsAt",
- "PlanItems"
+ "Duration"
],
"type": "string"
}
@@ -4980,8 +5530,7 @@
"type": "array",
"items": {
"enum": [
- "*",
- "PlanItems"
+ "*"
],
"type": "string"
}
@@ -4994,13 +5543,13 @@
"content": {
"application/json": {
"schema": {
- "title": "Collection of Trip",
+ "title": "Collection of PlanItem",
"type": "object",
"properties": {
"value": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
+ "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem"
}
}
}
@@ -5015,106 +5564,13 @@
"x-ms-docs-operation-type": "operation"
}
},
- "/People/{UserName}/Trips/{TripId}": {
- "get": {
- "tags": [
- "People.Trip"
- ],
- "summary": "Get Trips from People",
- "operationId": "People.GetTrips",
- "parameters": [
- {
- "name": "UserName",
- "in": "path",
- "description": "key: UserName of Person",
- "required": true,
- "schema": {
- "type": "string"
- },
- "x-ms-docs-key-type": "Person"
- },
- {
- "name": "TripId",
- "in": "path",
- "description": "key: TripId of Trip",
- "required": true,
- "schema": {
- "maximum": 2147483647,
- "minimum": -2147483648,
- "type": "integer",
- "format": "int32"
- },
- "x-ms-docs-key-type": "Trip"
- },
- {
- "name": "$select",
- "in": "query",
- "description": "Select properties to be returned",
- "style": "form",
- "explode": false,
- "schema": {
- "uniqueItems": true,
- "type": "array",
- "items": {
- "enum": [
- "TripId",
- "ShareId",
- "Name",
- "Budget",
- "Description",
- "Tags",
- "StartsAt",
- "EndsAt",
- "PlanItems"
- ],
- "type": "string"
- }
- }
- },
- {
- "name": "$expand",
- "in": "query",
- "description": "Expand related entities",
- "style": "form",
- "explode": false,
- "schema": {
- "uniqueItems": true,
- "type": "array",
- "items": {
- "enum": [
- "*",
- "PlanItems"
- ],
- "type": "string"
- }
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Retrieved navigation property",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip"
- }
- }
- }
- },
- "default": {
- "$ref": "#/components/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
- }
- },
- "/People/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": {
+ "/People/{UserName}/Trips/{TripId}/PlanItems/$ref": {
"get": {
"tags": [
- "People.Functions"
+ "People.Trips.PlanItem"
],
- "summary": "Invoke function GetInvolvedPeople",
- "operationId": "People.Trips.GetInvolvedPeople",
+ "summary": "Get ref of PlanItems from People",
+ "operationId": "People.Trips.ListRefPlanItems",
"parameters": [
{
"name": "UserName",
@@ -5138,51 +5594,6 @@
"format": "int32"
},
"x-ms-docs-key-type": "Trip"
- }
- ],
- "responses": {
- "200": {
- "description": "Success",
- "content": {
- "application/json": {
- "schema": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person"
- }
- ],
- "nullable": true
- }
- }
- }
- }
- },
- "default": {
- "$ref": "#/components/responses/error"
- }
- },
- "x-ms-docs-operation-type": "function"
- }
- },
- "/People/{UserName}/Trips/$ref": {
- "get": {
- "tags": [
- "People.Trip"
- ],
- "summary": "Get ref of Trips from People",
- "operationId": "People.ListRefTrips",
- "parameters": [
- {
- "name": "UserName",
- "in": "path",
- "description": "key: UserName of Person",
- "required": true,
- "schema": {
- "type": "string"
- },
- "x-ms-docs-key-type": "Person"
},
{
"$ref": "#/components/parameters/top"
@@ -5210,22 +5621,16 @@
"type": "array",
"items": {
"enum": [
- "TripId",
- "TripId desc",
- "ShareId",
- "ShareId desc",
- "Name",
- "Name desc",
- "Budget",
- "Budget desc",
- "Description",
- "Description desc",
- "Tags",
- "Tags desc",
+ "PlanItemId",
+ "PlanItemId desc",
+ "ConfirmationCode",
+ "ConfirmationCode desc",
"StartsAt",
"StartsAt desc",
"EndsAt",
- "EndsAt desc"
+ "EndsAt desc",
+ "Duration",
+ "Duration desc"
],
"type": "string"
}
@@ -5238,7 +5643,7 @@
"content": {
"application/json": {
"schema": {
- "title": "Collection of links of Trip",
+ "title": "Collection of links of PlanItem",
"type": "object",
"properties": {
"value": {
@@ -5260,10 +5665,10 @@
},
"post": {
"tags": [
- "People.Trip"
+ "People.Trips.PlanItem"
],
- "summary": "Create new navigation property ref to Trips for People",
- "operationId": "People.CreateRefTrips",
+ "summary": "Create new navigation property ref to PlanItems for People",
+ "operationId": "People.Trips.CreateRefPlanItems",
"parameters": [
{
"name": "UserName",
@@ -5274,6 +5679,19 @@
"type": "string"
},
"x-ms-docs-key-type": "Person"
+ },
+ {
+ "name": "TripId",
+ "in": "path",
+ "description": "key: TripId of Trip",
+ "required": true,
+ "schema": {
+ "maximum": 2147483647,
+ "minimum": -2147483648,
+ "type": "integer",
+ "format": "int32"
+ },
+ "x-ms-docs-key-type": "Trip"
}
],
"requestBody": {
@@ -5281,7 +5699,10 @@
"content": {
"application/json": {
"schema": {
- "type": "String"
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
}
}
},
@@ -5293,7 +5714,7 @@
"content": {
"application/json": {
"schema": {
- "type": "String"
+ "type": "object"
}
}
}
@@ -5303,50 +5724,6 @@
}
},
"x-ms-docs-operation-type": "operation"
- },
- "delete": {
- "tags": [
- "People.Trip"
- ],
- "summary": "Delete ref of navigation property Trips for People",
- "operationId": "People.DeleteRefTrips",
- "parameters": [
- {
- "name": "UserName",
- "in": "path",
- "description": "key: UserName of Person",
- "required": true,
- "schema": {
- "type": "string"
- },
- "x-ms-docs-key-type": "Person"
- },
- {
- "name": "If-Match",
- "in": "header",
- "description": "ETag",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "@id",
- "in": "query",
- "description": "Delete Uri",
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "204": {
- "description": "Success"
- },
- "default": {
- "$ref": "#/components/responses/error"
- }
- },
- "x-ms-docs-operation-type": "operation"
}
},
"/ResetDataSource": {
@@ -6372,6 +6749,10 @@
"name": "Me.Trip",
"x-ms-docs-toc-type": "page"
},
+ {
+ "name": "Me.Trips.PlanItem",
+ "x-ms-docs-toc-type": "page"
+ },
{
"name": "NewComePeople.Person",
"x-ms-docs-toc-type": "page"
@@ -6388,6 +6769,10 @@
"name": "NewComePeople.Trip",
"x-ms-docs-toc-type": "page"
},
+ {
+ "name": "NewComePeople.Trips.PlanItem",
+ "x-ms-docs-toc-type": "page"
+ },
{
"name": "People.Person",
"x-ms-docs-toc-type": "page"
@@ -6404,6 +6789,10 @@
"name": "People.Trip",
"x-ms-docs-toc-type": "page"
},
+ {
+ "name": "People.Trips.PlanItem",
+ "x-ms-docs-toc-type": "page"
+ },
{
"name": "ResetDataSource",
"x-ms-docs-toc-type": "container"
diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml
index ec59ccc8..ad73cb2a 100644
--- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml
+++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml
@@ -599,7 +599,7 @@ paths:
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
- patch:
+ put:
tags:
- Me.Person
summary: Update the ref of navigation property BestFriend in Me
@@ -609,7 +609,9 @@ paths:
content:
application/json:
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
required: true
responses:
'204':
@@ -735,70 +737,6 @@ paths:
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
- '/Me/Friends/{UserName}':
- get:
- tags:
- - Me.Person
- summary: Get Friends from Me
- operationId: Me.GetFriends
- parameters:
- - name: UserName
- in: path
- description: 'key: UserName of Person'
- required: true
- schema:
- type: string
- x-ms-docs-key-type: Person
- - name: $select
- in: query
- description: Select properties to be returned
- style: form
- explode: false
- schema:
- uniqueItems: true
- type: array
- items:
- enum:
- - UserName
- - FirstName
- - LastName
- - MiddleName
- - Gender
- - Age
- - Emails
- - AddressInfo
- - HomeAddress
- - FavoriteFeature
- - Features
- - Friends
- - BestFriend
- - Trips
- type: string
- - name: $expand
- in: query
- description: Expand related entities
- style: form
- explode: false
- schema:
- uniqueItems: true
- type: array
- items:
- enum:
- - '*'
- - Friends
- - BestFriend
- - Trips
- type: string
- responses:
- '200':
- description: Retrieved navigation property
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person'
- default:
- $ref: '#/components/responses/error'
- x-ms-docs-operation-type: operation
/Me/Friends/$ref:
get:
tags:
@@ -870,7 +808,9 @@ paths:
content:
application/json:
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
required: true
responses:
'201':
@@ -878,29 +818,7 @@ paths:
content:
application/json:
schema:
- type: String
- default:
- $ref: '#/components/responses/error'
- x-ms-docs-operation-type: operation
- delete:
- tags:
- - Me.Person
- summary: Delete ref of navigation property Friends for Me
- operationId: Me.DeleteRefFriends
- parameters:
- - name: If-Match
- in: header
- description: ETag
- schema:
- type: string
- - name: '@id'
- in: query
- description: Delete Uri
- schema:
- type: string
- responses:
- '204':
- description: Success
+ type: object
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
@@ -1121,6 +1039,28 @@ paths:
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
+ post:
+ tags:
+ - Me.Trip
+ summary: Create new navigation property to Trips for Me
+ operationId: Me.CreateTrips
+ requestBody:
+ description: New navigation property
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ required: true
+ responses:
+ '201':
+ description: Created navigation property.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ default:
+ $ref: '#/components/responses/error'
+ x-ms-docs-operation-type: operation
'/Me/Trips/{TripId}':
get:
tags:
@@ -1181,6 +1121,62 @@ paths:
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
+ patch:
+ tags:
+ - Me.Trip
+ summary: Update the navigation property Trips in Me
+ operationId: Me.UpdateTrips
+ parameters:
+ - name: TripId
+ in: path
+ description: 'key: TripId of Trip'
+ required: true
+ schema:
+ maximum: 2147483647
+ minimum: -2147483648
+ type: integer
+ format: int32
+ x-ms-docs-key-type: Trip
+ requestBody:
+ description: New navigation property values
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ required: true
+ responses:
+ '204':
+ description: Success
+ default:
+ $ref: '#/components/responses/error'
+ x-ms-docs-operation-type: operation
+ delete:
+ tags:
+ - Me.Trip
+ summary: Delete navigation property Trips for Me
+ operationId: Me.DeleteTrips
+ parameters:
+ - name: TripId
+ in: path
+ description: 'key: TripId of Trip'
+ required: true
+ schema:
+ maximum: 2147483647
+ minimum: -2147483648
+ type: integer
+ format: int32
+ x-ms-docs-key-type: Trip
+ - name: If-Match
+ in: header
+ description: ETag
+ schema:
+ type: string
+ responses:
+ '204':
+ description: Success
+ default:
+ $ref: '#/components/responses/error'
+ x-ms-docs-operation-type: operation
'/Me/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()':
get:
tags:
@@ -1212,13 +1208,23 @@ paths:
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: function
- /Me/Trips/$ref:
+ '/Me/Trips/{TripId}/PlanItems':
get:
tags:
- - Me.Trip
- summary: Get ref of Trips from Me
- operationId: Me.ListRefTrips
+ - Me.Trips.PlanItem
+ summary: Get PlanItems from Me
+ operationId: Me.Trips.ListPlanItems
parameters:
+ - name: TripId
+ in: path
+ description: 'key: TripId of Trip'
+ required: true
+ schema:
+ maximum: 2147483647
+ minimum: -2147483648
+ type: integer
+ format: int32
+ x-ms-docs-key-type: Trip
- $ref: '#/components/parameters/top'
- $ref: '#/components/parameters/skip'
- $ref: '#/components/parameters/search'
@@ -1234,90 +1240,78 @@ paths:
type: array
items:
enum:
- - TripId
- - TripId desc
- - ShareId
- - ShareId desc
- - Name
- - Name desc
- - Budget
- - Budget desc
- - Description
- - Description desc
- - Tags
- - Tags desc
+ - PlanItemId
+ - PlanItemId desc
+ - ConfirmationCode
+ - ConfirmationCode desc
- StartsAt
- StartsAt desc
- EndsAt
- EndsAt desc
+ - Duration
+ - Duration desc
+ type: string
+ - name: $select
+ in: query
+ description: Select properties to be returned
+ style: form
+ explode: false
+ schema:
+ uniqueItems: true
+ type: array
+ items:
+ enum:
+ - PlanItemId
+ - ConfirmationCode
+ - StartsAt
+ - EndsAt
+ - Duration
+ type: string
+ - name: $expand
+ in: query
+ description: Expand related entities
+ style: form
+ explode: false
+ schema:
+ uniqueItems: true
+ type: array
+ items:
+ enum:
+ - '*'
type: string
responses:
'200':
- description: Retrieved navigation property links
+ description: Retrieved navigation property
content:
application/json:
schema:
- title: Collection of links of Trip
+ title: Collection of PlanItem
type: object
properties:
value:
type: array
items:
- type: string
- default:
- $ref: '#/components/responses/error'
- x-ms-docs-operation-type: operation
- post:
- tags:
- - Me.Trip
- summary: Create new navigation property ref to Trips for Me
- operationId: Me.CreateRefTrips
- requestBody:
- description: New navigation property ref value
- content:
- application/json:
- schema:
- type: String
- required: true
- responses:
- '201':
- description: Created navigation property link.
- content:
- application/json:
- schema:
- type: String
- default:
- $ref: '#/components/responses/error'
- x-ms-docs-operation-type: operation
- delete:
- tags:
- - Me.Trip
- summary: Delete ref of navigation property Trips for Me
- operationId: Me.DeleteRefTrips
- parameters:
- - name: If-Match
- in: header
- description: ETag
- schema:
- type: string
- - name: '@id'
- in: query
- description: Delete Uri
- schema:
- type: string
- responses:
- '204':
- description: Success
+ $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem'
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
- /NewComePeople:
+ '/Me/Trips/{TripId}/PlanItems/$ref':
get:
tags:
- - NewComePeople.Person
- summary: Get entities from NewComePeople
- operationId: NewComePeople.Person.ListPerson
+ - Me.Trips.PlanItem
+ summary: Get ref of PlanItems from Me
+ operationId: Me.Trips.ListRefPlanItems
parameters:
+ - name: TripId
+ in: path
+ description: 'key: TripId of Trip'
+ required: true
+ schema:
+ maximum: 2147483647
+ minimum: -2147483648
+ type: integer
+ format: int32
+ x-ms-docs-key-type: Trip
- $ref: '#/components/parameters/top'
- $ref: '#/components/parameters/skip'
- $ref: '#/components/parameters/search'
@@ -1333,8 +1327,92 @@ paths:
type: array
items:
enum:
- - UserName
- - UserName desc
+ - PlanItemId
+ - PlanItemId desc
+ - ConfirmationCode
+ - ConfirmationCode desc
+ - StartsAt
+ - StartsAt desc
+ - EndsAt
+ - EndsAt desc
+ - Duration
+ - Duration desc
+ type: string
+ responses:
+ '200':
+ description: Retrieved navigation property links
+ content:
+ application/json:
+ schema:
+ title: Collection of links of PlanItem
+ type: object
+ properties:
+ value:
+ type: array
+ items:
+ type: string
+ default:
+ $ref: '#/components/responses/error'
+ x-ms-docs-operation-type: operation
+ post:
+ tags:
+ - Me.Trips.PlanItem
+ summary: Create new navigation property ref to PlanItems for Me
+ operationId: Me.Trips.CreateRefPlanItems
+ parameters:
+ - name: TripId
+ in: path
+ description: 'key: TripId of Trip'
+ required: true
+ schema:
+ maximum: 2147483647
+ minimum: -2147483648
+ type: integer
+ format: int32
+ x-ms-docs-key-type: Trip
+ requestBody:
+ description: New navigation property ref value
+ content:
+ application/json:
+ schema:
+ type: object
+ additionalProperties:
+ type: object
+ required: true
+ responses:
+ '201':
+ description: Created navigation property link.
+ content:
+ application/json:
+ schema:
+ type: object
+ default:
+ $ref: '#/components/responses/error'
+ x-ms-docs-operation-type: operation
+ /NewComePeople:
+ get:
+ tags:
+ - NewComePeople.Person
+ summary: Get entities from NewComePeople
+ operationId: NewComePeople.Person.ListPerson
+ parameters:
+ - $ref: '#/components/parameters/top'
+ - $ref: '#/components/parameters/skip'
+ - $ref: '#/components/parameters/search'
+ - $ref: '#/components/parameters/filter'
+ - $ref: '#/components/parameters/count'
+ - name: $orderby
+ in: query
+ description: Order items by property values
+ style: form
+ explode: false
+ schema:
+ uniqueItems: true
+ type: array
+ items:
+ enum:
+ - UserName
+ - UserName desc
- FirstName
- FirstName desc
- LastName
@@ -1635,7 +1713,7 @@ paths:
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
- patch:
+ put:
tags:
- NewComePeople.Person
summary: Update the ref of navigation property BestFriend in NewComePeople
@@ -1653,7 +1731,9 @@ paths:
content:
application/json:
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
required: true
responses:
'204':
@@ -1793,77 +1873,6 @@ paths:
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
- '/NewComePeople/{UserName}/Friends/{UserName1}':
- get:
- tags:
- - NewComePeople.Person
- summary: Get Friends from NewComePeople
- operationId: NewComePeople.GetFriends
- parameters:
- - name: UserName
- in: path
- description: 'key: UserName of Person'
- required: true
- schema:
- type: string
- x-ms-docs-key-type: Person
- - name: UserName1
- in: path
- description: 'key: UserName of Person'
- required: true
- schema:
- type: string
- x-ms-docs-key-type: Person
- - name: $select
- in: query
- description: Select properties to be returned
- style: form
- explode: false
- schema:
- uniqueItems: true
- type: array
- items:
- enum:
- - UserName
- - FirstName
- - LastName
- - MiddleName
- - Gender
- - Age
- - Emails
- - AddressInfo
- - HomeAddress
- - FavoriteFeature
- - Features
- - Friends
- - BestFriend
- - Trips
- type: string
- - name: $expand
- in: query
- description: Expand related entities
- style: form
- explode: false
- schema:
- uniqueItems: true
- type: array
- items:
- enum:
- - '*'
- - Friends
- - BestFriend
- - Trips
- type: string
- responses:
- '200':
- description: Retrieved navigation property
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person'
- default:
- $ref: '#/components/responses/error'
- x-ms-docs-operation-type: operation
'/NewComePeople/{UserName}/Friends/$ref':
get:
tags:
@@ -1950,7 +1959,9 @@ paths:
content:
application/json:
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
required: true
responses:
'201':
@@ -1958,36 +1969,7 @@ paths:
content:
application/json:
schema:
- type: String
- default:
- $ref: '#/components/responses/error'
- x-ms-docs-operation-type: operation
- delete:
- tags:
- - NewComePeople.Person
- summary: Delete ref of navigation property Friends for NewComePeople
- operationId: NewComePeople.DeleteRefFriends
- parameters:
- - name: UserName
- in: path
- description: 'key: UserName of Person'
- required: true
- schema:
- type: string
- x-ms-docs-key-type: Person
- - name: If-Match
- in: header
- description: ETag
- schema:
- type: string
- - name: '@id'
- in: query
- description: Delete Uri
- schema:
- type: string
- responses:
- '204':
- description: Success
+ type: object
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
@@ -2158,12 +2140,312 @@ paths:
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: function
- '/NewComePeople/{UserName}/Trips':
+ '/NewComePeople/{UserName}/Trips':
+ get:
+ tags:
+ - NewComePeople.Trip
+ summary: Get Trips from NewComePeople
+ operationId: NewComePeople.ListTrips
+ parameters:
+ - name: UserName
+ in: path
+ description: 'key: UserName of Person'
+ required: true
+ schema:
+ type: string
+ x-ms-docs-key-type: Person
+ - $ref: '#/components/parameters/top'
+ - $ref: '#/components/parameters/skip'
+ - $ref: '#/components/parameters/search'
+ - $ref: '#/components/parameters/filter'
+ - $ref: '#/components/parameters/count'
+ - name: $orderby
+ in: query
+ description: Order items by property values
+ style: form
+ explode: false
+ schema:
+ uniqueItems: true
+ type: array
+ items:
+ enum:
+ - TripId
+ - TripId desc
+ - ShareId
+ - ShareId desc
+ - Name
+ - Name desc
+ - Budget
+ - Budget desc
+ - Description
+ - Description desc
+ - Tags
+ - Tags desc
+ - StartsAt
+ - StartsAt desc
+ - EndsAt
+ - EndsAt desc
+ type: string
+ - name: $select
+ in: query
+ description: Select properties to be returned
+ style: form
+ explode: false
+ schema:
+ uniqueItems: true
+ type: array
+ items:
+ enum:
+ - TripId
+ - ShareId
+ - Name
+ - Budget
+ - Description
+ - Tags
+ - StartsAt
+ - EndsAt
+ - PlanItems
+ type: string
+ - name: $expand
+ in: query
+ description: Expand related entities
+ style: form
+ explode: false
+ schema:
+ uniqueItems: true
+ type: array
+ items:
+ enum:
+ - '*'
+ - PlanItems
+ type: string
+ responses:
+ '200':
+ description: Retrieved navigation property
+ content:
+ application/json:
+ schema:
+ title: Collection of Trip
+ type: object
+ properties:
+ value:
+ type: array
+ items:
+ $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ default:
+ $ref: '#/components/responses/error'
+ x-ms-docs-operation-type: operation
+ post:
+ tags:
+ - NewComePeople.Trip
+ summary: Create new navigation property to Trips for NewComePeople
+ operationId: NewComePeople.CreateTrips
+ parameters:
+ - name: UserName
+ in: path
+ description: 'key: UserName of Person'
+ required: true
+ schema:
+ type: string
+ x-ms-docs-key-type: Person
+ requestBody:
+ description: New navigation property
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ required: true
+ responses:
+ '201':
+ description: Created navigation property.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ default:
+ $ref: '#/components/responses/error'
+ x-ms-docs-operation-type: operation
+ '/NewComePeople/{UserName}/Trips/{TripId}':
+ get:
+ tags:
+ - NewComePeople.Trip
+ summary: Get Trips from NewComePeople
+ operationId: NewComePeople.GetTrips
+ parameters:
+ - name: UserName
+ in: path
+ description: 'key: UserName of Person'
+ required: true
+ schema:
+ type: string
+ x-ms-docs-key-type: Person
+ - name: TripId
+ in: path
+ description: 'key: TripId of Trip'
+ required: true
+ schema:
+ maximum: 2147483647
+ minimum: -2147483648
+ type: integer
+ format: int32
+ x-ms-docs-key-type: Trip
+ - name: $select
+ in: query
+ description: Select properties to be returned
+ style: form
+ explode: false
+ schema:
+ uniqueItems: true
+ type: array
+ items:
+ enum:
+ - TripId
+ - ShareId
+ - Name
+ - Budget
+ - Description
+ - Tags
+ - StartsAt
+ - EndsAt
+ - PlanItems
+ type: string
+ - name: $expand
+ in: query
+ description: Expand related entities
+ style: form
+ explode: false
+ schema:
+ uniqueItems: true
+ type: array
+ items:
+ enum:
+ - '*'
+ - PlanItems
+ type: string
+ responses:
+ '200':
+ description: Retrieved navigation property
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ default:
+ $ref: '#/components/responses/error'
+ x-ms-docs-operation-type: operation
+ patch:
+ tags:
+ - NewComePeople.Trip
+ summary: Update the navigation property Trips in NewComePeople
+ operationId: NewComePeople.UpdateTrips
+ parameters:
+ - name: UserName
+ in: path
+ description: 'key: UserName of Person'
+ required: true
+ schema:
+ type: string
+ x-ms-docs-key-type: Person
+ - name: TripId
+ in: path
+ description: 'key: TripId of Trip'
+ required: true
+ schema:
+ maximum: 2147483647
+ minimum: -2147483648
+ type: integer
+ format: int32
+ x-ms-docs-key-type: Trip
+ requestBody:
+ description: New navigation property values
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ required: true
+ responses:
+ '204':
+ description: Success
+ default:
+ $ref: '#/components/responses/error'
+ x-ms-docs-operation-type: operation
+ delete:
+ tags:
+ - NewComePeople.Trip
+ summary: Delete navigation property Trips for NewComePeople
+ operationId: NewComePeople.DeleteTrips
+ parameters:
+ - name: UserName
+ in: path
+ description: 'key: UserName of Person'
+ required: true
+ schema:
+ type: string
+ x-ms-docs-key-type: Person
+ - name: TripId
+ in: path
+ description: 'key: TripId of Trip'
+ required: true
+ schema:
+ maximum: 2147483647
+ minimum: -2147483648
+ type: integer
+ format: int32
+ x-ms-docs-key-type: Trip
+ - name: If-Match
+ in: header
+ description: ETag
+ schema:
+ type: string
+ responses:
+ '204':
+ description: Success
+ default:
+ $ref: '#/components/responses/error'
+ x-ms-docs-operation-type: operation
+ '/NewComePeople/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()':
+ get:
+ tags:
+ - NewComePeople.Functions
+ summary: Invoke function GetInvolvedPeople
+ operationId: NewComePeople.Trips.GetInvolvedPeople
+ parameters:
+ - name: UserName
+ in: path
+ description: 'key: UserName of Person'
+ required: true
+ schema:
+ type: string
+ x-ms-docs-key-type: Person
+ - name: TripId
+ in: path
+ description: 'key: TripId of Trip'
+ required: true
+ schema:
+ maximum: 2147483647
+ minimum: -2147483648
+ type: integer
+ format: int32
+ x-ms-docs-key-type: Trip
+ responses:
+ '200':
+ description: Success
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person'
+ nullable: true
+ default:
+ $ref: '#/components/responses/error'
+ x-ms-docs-operation-type: function
+ '/NewComePeople/{UserName}/Trips/{TripId}/PlanItems':
get:
tags:
- - NewComePeople.Trip
- summary: Get Trips from NewComePeople
- operationId: NewComePeople.ListTrips
+ - NewComePeople.Trips.PlanItem
+ summary: Get PlanItems from NewComePeople
+ operationId: NewComePeople.Trips.ListPlanItems
parameters:
- name: UserName
in: path
@@ -2172,6 +2454,16 @@ paths:
schema:
type: string
x-ms-docs-key-type: Person
+ - name: TripId
+ in: path
+ description: 'key: TripId of Trip'
+ required: true
+ schema:
+ maximum: 2147483647
+ minimum: -2147483648
+ type: integer
+ format: int32
+ x-ms-docs-key-type: Trip
- $ref: '#/components/parameters/top'
- $ref: '#/components/parameters/skip'
- $ref: '#/components/parameters/search'
@@ -2187,22 +2479,16 @@ paths:
type: array
items:
enum:
- - TripId
- - TripId desc
- - ShareId
- - ShareId desc
- - Name
- - Name desc
- - Budget
- - Budget desc
- - Description
- - Description desc
- - Tags
- - Tags desc
+ - PlanItemId
+ - PlanItemId desc
+ - ConfirmationCode
+ - ConfirmationCode desc
- StartsAt
- StartsAt desc
- EndsAt
- EndsAt desc
+ - Duration
+ - Duration desc
type: string
- name: $select
in: query
@@ -2214,15 +2500,11 @@ paths:
type: array
items:
enum:
- - TripId
- - ShareId
- - Name
- - Budget
- - Description
- - Tags
+ - PlanItemId
+ - ConfirmationCode
- StartsAt
- EndsAt
- - PlanItems
+ - Duration
type: string
- name: $expand
in: query
@@ -2235,7 +2517,6 @@ paths:
items:
enum:
- '*'
- - PlanItems
type: string
responses:
'200':
@@ -2243,89 +2524,22 @@ paths:
content:
application/json:
schema:
- title: Collection of Trip
+ title: Collection of PlanItem
type: object
properties:
value:
type: array
items:
- $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
- default:
- $ref: '#/components/responses/error'
- x-ms-docs-operation-type: operation
- '/NewComePeople/{UserName}/Trips/{TripId}':
- get:
- tags:
- - NewComePeople.Trip
- summary: Get Trips from NewComePeople
- operationId: NewComePeople.GetTrips
- parameters:
- - name: UserName
- in: path
- description: 'key: UserName of Person'
- required: true
- schema:
- type: string
- x-ms-docs-key-type: Person
- - name: TripId
- in: path
- description: 'key: TripId of Trip'
- required: true
- schema:
- maximum: 2147483647
- minimum: -2147483648
- type: integer
- format: int32
- x-ms-docs-key-type: Trip
- - name: $select
- in: query
- description: Select properties to be returned
- style: form
- explode: false
- schema:
- uniqueItems: true
- type: array
- items:
- enum:
- - TripId
- - ShareId
- - Name
- - Budget
- - Description
- - Tags
- - StartsAt
- - EndsAt
- - PlanItems
- type: string
- - name: $expand
- in: query
- description: Expand related entities
- style: form
- explode: false
- schema:
- uniqueItems: true
- type: array
- items:
- enum:
- - '*'
- - PlanItems
- type: string
- responses:
- '200':
- description: Retrieved navigation property
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem'
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
- '/NewComePeople/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()':
+ '/NewComePeople/{UserName}/Trips/{TripId}/PlanItems/$ref':
get:
tags:
- - NewComePeople.Functions
- summary: Invoke function GetInvolvedPeople
- operationId: NewComePeople.Trips.GetInvolvedPeople
+ - NewComePeople.Trips.PlanItem
+ summary: Get ref of PlanItems from NewComePeople
+ operationId: NewComePeople.Trips.ListRefPlanItems
parameters:
- name: UserName
in: path
@@ -2344,34 +2558,6 @@ paths:
type: integer
format: int32
x-ms-docs-key-type: Trip
- responses:
- '200':
- description: Success
- content:
- application/json:
- schema:
- type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person'
- nullable: true
- default:
- $ref: '#/components/responses/error'
- x-ms-docs-operation-type: function
- '/NewComePeople/{UserName}/Trips/$ref':
- get:
- tags:
- - NewComePeople.Trip
- summary: Get ref of Trips from NewComePeople
- operationId: NewComePeople.ListRefTrips
- parameters:
- - name: UserName
- in: path
- description: 'key: UserName of Person'
- required: true
- schema:
- type: string
- x-ms-docs-key-type: Person
- $ref: '#/components/parameters/top'
- $ref: '#/components/parameters/skip'
- $ref: '#/components/parameters/search'
@@ -2387,22 +2573,16 @@ paths:
type: array
items:
enum:
- - TripId
- - TripId desc
- - ShareId
- - ShareId desc
- - Name
- - Name desc
- - Budget
- - Budget desc
- - Description
- - Description desc
- - Tags
- - Tags desc
+ - PlanItemId
+ - PlanItemId desc
+ - ConfirmationCode
+ - ConfirmationCode desc
- StartsAt
- StartsAt desc
- EndsAt
- EndsAt desc
+ - Duration
+ - Duration desc
type: string
responses:
'200':
@@ -2410,7 +2590,7 @@ paths:
content:
application/json:
schema:
- title: Collection of links of Trip
+ title: Collection of links of PlanItem
type: object
properties:
value:
@@ -2422,9 +2602,9 @@ paths:
x-ms-docs-operation-type: operation
post:
tags:
- - NewComePeople.Trip
- summary: Create new navigation property ref to Trips for NewComePeople
- operationId: NewComePeople.CreateRefTrips
+ - NewComePeople.Trips.PlanItem
+ summary: Create new navigation property ref to PlanItems for NewComePeople
+ operationId: NewComePeople.Trips.CreateRefPlanItems
parameters:
- name: UserName
in: path
@@ -2433,12 +2613,24 @@ paths:
schema:
type: string
x-ms-docs-key-type: Person
+ - name: TripId
+ in: path
+ description: 'key: TripId of Trip'
+ required: true
+ schema:
+ maximum: 2147483647
+ minimum: -2147483648
+ type: integer
+ format: int32
+ x-ms-docs-key-type: Trip
requestBody:
description: New navigation property ref value
content:
application/json:
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
required: true
responses:
'201':
@@ -2446,36 +2638,7 @@ paths:
content:
application/json:
schema:
- type: String
- default:
- $ref: '#/components/responses/error'
- x-ms-docs-operation-type: operation
- delete:
- tags:
- - NewComePeople.Trip
- summary: Delete ref of navigation property Trips for NewComePeople
- operationId: NewComePeople.DeleteRefTrips
- parameters:
- - name: UserName
- in: path
- description: 'key: UserName of Person'
- required: true
- schema:
- type: string
- x-ms-docs-key-type: Person
- - name: If-Match
- in: header
- description: ETag
- schema:
- type: string
- - name: '@id'
- in: query
- description: Delete Uri
- schema:
- type: string
- responses:
- '204':
- description: Success
+ type: object
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
@@ -2803,7 +2966,7 @@ paths:
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
- patch:
+ put:
tags:
- People.Person
summary: Update the ref of navigation property BestFriend in People
@@ -2821,7 +2984,9 @@ paths:
content:
application/json:
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
required: true
responses:
'204':
@@ -2957,78 +3122,7 @@ paths:
value:
type: array
items:
- $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person'
- default:
- $ref: '#/components/responses/error'
- x-ms-docs-operation-type: operation
- '/People/{UserName}/Friends/{UserName1}':
- get:
- tags:
- - People.Person
- summary: Get Friends from People
- operationId: People.GetFriends
- parameters:
- - name: UserName
- in: path
- description: 'key: UserName of Person'
- required: true
- schema:
- type: string
- x-ms-docs-key-type: Person
- - name: UserName1
- in: path
- description: 'key: UserName of Person'
- required: true
- schema:
- type: string
- x-ms-docs-key-type: Person
- - name: $select
- in: query
- description: Select properties to be returned
- style: form
- explode: false
- schema:
- uniqueItems: true
- type: array
- items:
- enum:
- - UserName
- - FirstName
- - LastName
- - MiddleName
- - Gender
- - Age
- - Emails
- - AddressInfo
- - HomeAddress
- - FavoriteFeature
- - Features
- - Friends
- - BestFriend
- - Trips
- type: string
- - name: $expand
- in: query
- description: Expand related entities
- style: form
- explode: false
- schema:
- uniqueItems: true
- type: array
- items:
- enum:
- - '*'
- - Friends
- - BestFriend
- - Trips
- type: string
- responses:
- '200':
- description: Retrieved navigation property
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person'
+ $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person'
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
@@ -3118,7 +3212,9 @@ paths:
content:
application/json:
schema:
- type: String
+ type: object
+ additionalProperties:
+ type: object
required: true
responses:
'201':
@@ -3126,36 +3222,7 @@ paths:
content:
application/json:
schema:
- type: String
- default:
- $ref: '#/components/responses/error'
- x-ms-docs-operation-type: operation
- delete:
- tags:
- - People.Person
- summary: Delete ref of navigation property Friends for People
- operationId: People.DeleteRefFriends
- parameters:
- - name: UserName
- in: path
- description: 'key: UserName of Person'
- required: true
- schema:
- type: string
- x-ms-docs-key-type: Person
- - name: If-Match
- in: header
- description: ETag
- schema:
- type: string
- - name: '@id'
- in: query
- description: Delete Uri
- schema:
- type: string
- responses:
- '204':
- description: Success
+ type: object
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
@@ -3421,6 +3488,36 @@ paths:
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
+ post:
+ tags:
+ - People.Trip
+ summary: Create new navigation property to Trips for People
+ operationId: People.CreateTrips
+ parameters:
+ - name: UserName
+ in: path
+ description: 'key: UserName of Person'
+ required: true
+ schema:
+ type: string
+ x-ms-docs-key-type: Person
+ requestBody:
+ description: New navigation property
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ required: true
+ responses:
+ '201':
+ description: Created navigation property.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ default:
+ $ref: '#/components/responses/error'
+ x-ms-docs-operation-type: operation
'/People/{UserName}/Trips/{TripId}':
get:
tags:
@@ -3488,6 +3585,76 @@ paths:
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
+ patch:
+ tags:
+ - People.Trip
+ summary: Update the navigation property Trips in People
+ operationId: People.UpdateTrips
+ parameters:
+ - name: UserName
+ in: path
+ description: 'key: UserName of Person'
+ required: true
+ schema:
+ type: string
+ x-ms-docs-key-type: Person
+ - name: TripId
+ in: path
+ description: 'key: TripId of Trip'
+ required: true
+ schema:
+ maximum: 2147483647
+ minimum: -2147483648
+ type: integer
+ format: int32
+ x-ms-docs-key-type: Trip
+ requestBody:
+ description: New navigation property values
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip'
+ required: true
+ responses:
+ '204':
+ description: Success
+ default:
+ $ref: '#/components/responses/error'
+ x-ms-docs-operation-type: operation
+ delete:
+ tags:
+ - People.Trip
+ summary: Delete navigation property Trips for People
+ operationId: People.DeleteTrips
+ parameters:
+ - name: UserName
+ in: path
+ description: 'key: UserName of Person'
+ required: true
+ schema:
+ type: string
+ x-ms-docs-key-type: Person
+ - name: TripId
+ in: path
+ description: 'key: TripId of Trip'
+ required: true
+ schema:
+ maximum: 2147483647
+ minimum: -2147483648
+ type: integer
+ format: int32
+ x-ms-docs-key-type: Trip
+ - name: If-Match
+ in: header
+ description: ETag
+ schema:
+ type: string
+ responses:
+ '204':
+ description: Success
+ default:
+ $ref: '#/components/responses/error'
+ x-ms-docs-operation-type: operation
'/People/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()':
get:
tags:
@@ -3526,12 +3693,12 @@ paths:
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: function
- '/People/{UserName}/Trips/$ref':
+ '/People/{UserName}/Trips/{TripId}/PlanItems':
get:
tags:
- - People.Trip
- summary: Get ref of Trips from People
- operationId: People.ListRefTrips
+ - People.Trips.PlanItem
+ summary: Get PlanItems from People
+ operationId: People.Trips.ListPlanItems
parameters:
- name: UserName
in: path
@@ -3540,6 +3707,16 @@ paths:
schema:
type: string
x-ms-docs-key-type: Person
+ - name: TripId
+ in: path
+ description: 'key: TripId of Trip'
+ required: true
+ schema:
+ maximum: 2147483647
+ minimum: -2147483648
+ type: integer
+ format: int32
+ x-ms-docs-key-type: Trip
- $ref: '#/components/parameters/top'
- $ref: '#/components/parameters/skip'
- $ref: '#/components/parameters/search'
@@ -3555,44 +3732,67 @@ paths:
type: array
items:
enum:
- - TripId
- - TripId desc
- - ShareId
- - ShareId desc
- - Name
- - Name desc
- - Budget
- - Budget desc
- - Description
- - Description desc
- - Tags
- - Tags desc
+ - PlanItemId
+ - PlanItemId desc
+ - ConfirmationCode
+ - ConfirmationCode desc
- StartsAt
- StartsAt desc
- EndsAt
- EndsAt desc
+ - Duration
+ - Duration desc
+ type: string
+ - name: $select
+ in: query
+ description: Select properties to be returned
+ style: form
+ explode: false
+ schema:
+ uniqueItems: true
+ type: array
+ items:
+ enum:
+ - PlanItemId
+ - ConfirmationCode
+ - StartsAt
+ - EndsAt
+ - Duration
+ type: string
+ - name: $expand
+ in: query
+ description: Expand related entities
+ style: form
+ explode: false
+ schema:
+ uniqueItems: true
+ type: array
+ items:
+ enum:
+ - '*'
type: string
responses:
'200':
- description: Retrieved navigation property links
+ description: Retrieved navigation property
content:
application/json:
schema:
- title: Collection of links of Trip
+ title: Collection of PlanItem
type: object
properties:
value:
type: array
items:
- type: string
+ $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem'
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
- post:
+ '/People/{UserName}/Trips/{TripId}/PlanItems/$ref':
+ get:
tags:
- - People.Trip
- summary: Create new navigation property ref to Trips for People
- operationId: People.CreateRefTrips
+ - People.Trips.PlanItem
+ summary: Get ref of PlanItems from People
+ operationId: People.Trips.ListRefPlanItems
parameters:
- name: UserName
in: path
@@ -3601,28 +3801,63 @@ paths:
schema:
type: string
x-ms-docs-key-type: Person
- requestBody:
- description: New navigation property ref value
- content:
- application/json:
- schema:
- type: String
- required: true
+ - name: TripId
+ in: path
+ description: 'key: TripId of Trip'
+ required: true
+ schema:
+ maximum: 2147483647
+ minimum: -2147483648
+ type: integer
+ format: int32
+ x-ms-docs-key-type: Trip
+ - $ref: '#/components/parameters/top'
+ - $ref: '#/components/parameters/skip'
+ - $ref: '#/components/parameters/search'
+ - $ref: '#/components/parameters/filter'
+ - $ref: '#/components/parameters/count'
+ - name: $orderby
+ in: query
+ description: Order items by property values
+ style: form
+ explode: false
+ schema:
+ uniqueItems: true
+ type: array
+ items:
+ enum:
+ - PlanItemId
+ - PlanItemId desc
+ - ConfirmationCode
+ - ConfirmationCode desc
+ - StartsAt
+ - StartsAt desc
+ - EndsAt
+ - EndsAt desc
+ - Duration
+ - Duration desc
+ type: string
responses:
- '201':
- description: Created navigation property link.
+ '200':
+ description: Retrieved navigation property links
content:
application/json:
schema:
- type: String
+ title: Collection of links of PlanItem
+ type: object
+ properties:
+ value:
+ type: array
+ items:
+ type: string
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
- delete:
+ post:
tags:
- - People.Trip
- summary: Delete ref of navigation property Trips for People
- operationId: People.DeleteRefTrips
+ - People.Trips.PlanItem
+ summary: Create new navigation property ref to PlanItems for People
+ operationId: People.Trips.CreateRefPlanItems
parameters:
- name: UserName
in: path
@@ -3631,19 +3866,32 @@ paths:
schema:
type: string
x-ms-docs-key-type: Person
- - name: If-Match
- in: header
- description: ETag
- schema:
- type: string
- - name: '@id'
- in: query
- description: Delete Uri
+ - name: TripId
+ in: path
+ description: 'key: TripId of Trip'
+ required: true
schema:
- type: string
+ maximum: 2147483647
+ minimum: -2147483648
+ type: integer
+ format: int32
+ x-ms-docs-key-type: Trip
+ requestBody:
+ description: New navigation property ref value
+ content:
+ application/json:
+ schema:
+ type: object
+ additionalProperties:
+ type: object
+ required: true
responses:
- '204':
- description: Success
+ '201':
+ description: Created navigation property link.
+ content:
+ application/json:
+ schema:
+ type: object
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
@@ -4278,6 +4526,8 @@ tags:
x-ms-docs-toc-type: container
- name: Me.Trip
x-ms-docs-toc-type: page
+ - name: Me.Trips.PlanItem
+ x-ms-docs-toc-type: page
- name: NewComePeople.Person
x-ms-docs-toc-type: page
- name: NewComePeople.Functions
@@ -4286,6 +4536,8 @@ tags:
x-ms-docs-toc-type: container
- name: NewComePeople.Trip
x-ms-docs-toc-type: page
+ - name: NewComePeople.Trips.PlanItem
+ x-ms-docs-toc-type: page
- name: People.Person
x-ms-docs-toc-type: page
- name: People.Functions
@@ -4294,5 +4546,7 @@ tags:
x-ms-docs-toc-type: container
- name: People.Trip
x-ms-docs-toc-type: page
+ - name: People.Trips.PlanItem
+ x-ms-docs-toc-type: page
- name: ResetDataSource
x-ms-docs-toc-type: container
\ No newline at end of file
diff --git a/tool/UpdateDocs/UpdateDocs.csproj b/tool/UpdateDocs/UpdateDocs.csproj
index a6fdfc75..809b34e9 100644
--- a/tool/UpdateDocs/UpdateDocs.csproj
+++ b/tool/UpdateDocs/UpdateDocs.csproj
@@ -35,8 +35,8 @@
packages\Microsoft.OData.Edm.7.6.1\lib\portable-net45+win8+wpa81\Microsoft.OData.Edm.dll
-
- packages\Microsoft.OpenApi.1.1.4\lib\net46\Microsoft.OpenApi.dll
+
+ packages\Microsoft.OpenApi.1.2.2\lib\net46\Microsoft.OpenApi.dll
diff --git a/tool/UpdateDocs/packages.config b/tool/UpdateDocs/packages.config
index 5c396329..e224131c 100644
--- a/tool/UpdateDocs/packages.config
+++ b/tool/UpdateDocs/packages.config
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/tool/versioning.props b/tool/versioning.props
index e8218a2c..22fc8ba8 100644
--- a/tool/versioning.props
+++ b/tool/versioning.props
@@ -14,7 +14,7 @@
1
0
- 3
+ 4