-
Notifications
You must be signed in to change notification settings - Fork 64
adds support for deprecation #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
52e8968
21035a9
ebfb2b3
cb5cbdc
ea94922
8ba904a
70d0ed0
582aecc
158ceca
8cc8efc
1ce2817
2c8578f
3a4431a
436cf76
47376c7
e314404
f738e9f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,9 @@ | |
using System.Collections.Generic; | ||
using System.Linq; | ||
using Microsoft.OData.Edm; | ||
using Microsoft.OpenApi.Models; | ||
using Microsoft.OpenApi.OData.Common; | ||
using Microsoft.OData.Edm.Vocabularies; | ||
using Microsoft.OpenApi.OData.OpenApiExtensions; | ||
|
||
namespace Microsoft.OpenApi.OData.Edm | ||
{ | ||
|
@@ -121,5 +122,14 @@ public string GetPathHash(OpenApiConvertSettings settings, ODataPath path = defa | |
/// <param name="parameters">The existing parameters.</param> | ||
/// <returns>The path item name.</returns> | ||
public abstract string GetPathItemName(OpenApiConvertSettings settings, HashSet<string> parameters); | ||
|
||
/// <summary> | ||
baywet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/// Provides any deprecation information for the segment. | ||
/// </summary> | ||
public OpenApiDeprecationExtension Deprecation { get; set; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The deprecation looks for the ODataPath, not a certain Segment in the Path, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. each segment can have deprecation information, which means a path can have multiple deprecations. Then the path will take the uppermost (shortest path) deprecation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a good example of that is
Assuming we have deprecation for all of those, the deprecation for the path that will be used, is the one from user, if user is not deprecated, the one from me, if not me, mailfolder, etc.... |
||
/// <summary> | ||
/// Returns the list of <see cref="IEdmVocabularyAnnotatable"/> this segment refers to. | ||
/// </summary> | ||
public abstract IEnumerable<IEdmVocabularyAnnotatable> GetAnnotables(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alignment the codes, tab -> 4 whitespaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems you can implement the default "GetAnnotables()" at the base class to return an empty Enumerable. Only override the method in the class that should be overridden?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason why I didn't make it virtual is because I want the compiler to error out in case we forgot a segment type instead of silently pass. This is going to come handy as we coordinate with PRs that add other segment types. But it could mean a breaking change for people whom inherited from the OData segment class, so I'm willing to compromise on this one. What do you think?