-
Notifications
You must be signed in to change notification settings - Fork 242
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
fix/headers reference #2091
Merged
+321
−246
Merged
fix/headers reference #2091
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2a10cd9
feat: splits described and summarized interfaces
baywet 68b25cc
fix: aligns callback parameter name with interface
baywet d7e1f91
fix: aligns parameter name with interface definition for example
baywet 77e0ad1
fix: Open API header proxy design pattern implementation
baywet aa80b19
fix: do not allow null argument for example copy constructor
baywet 0cb4ccb
fix: adds missing null propagation operators for callback and header …
baywet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
|
||
using System.Collections.Generic; | ||
using System.Text.Json.Nodes; | ||
using Microsoft.OpenApi.Interfaces; | ||
|
||
namespace Microsoft.OpenApi.Models.Interfaces; | ||
|
||
/// <summary> | ||
/// Defines the base properties for the headers object. | ||
/// This interface is provided for type assertions but should not be implemented by package consumers beyond automatic mocking. | ||
/// </summary> | ||
public interface IOpenApiHeader : IOpenApiDescribedElement, IOpenApiSerializable, IOpenApiReadOnlyExtensible | ||
{ | ||
/// <summary> | ||
/// Determines whether this header is mandatory. | ||
/// </summary> | ||
public bool Required { get; } | ||
|
||
/// <summary> | ||
/// Specifies that a header is deprecated and SHOULD be transitioned out of usage. | ||
/// </summary> | ||
public bool Deprecated { get; } | ||
|
||
/// <summary> | ||
/// Sets the ability to pass empty-valued headers. | ||
/// </summary> | ||
public bool AllowEmptyValue { get; } | ||
|
||
/// <summary> | ||
/// Describes how the header value will be serialized depending on the type of the header value. | ||
/// </summary> | ||
public ParameterStyle? Style { get; } | ||
|
||
/// <summary> | ||
/// When this is true, header values of type array or object generate separate parameters | ||
/// for each value of the array or key-value pair of the map. | ||
/// </summary> | ||
public bool Explode { get; } | ||
|
||
/// <summary> | ||
/// Determines whether the header value SHOULD allow reserved characters, as defined by RFC3986. | ||
/// </summary> | ||
public bool AllowReserved { get; } | ||
|
||
/// <summary> | ||
/// The schema defining the type used for the request body. | ||
/// </summary> | ||
public OpenApiSchema Schema { get; } | ||
|
||
/// <summary> | ||
/// Example of the media type. | ||
/// </summary> | ||
public JsonNode Example { get; } | ||
|
||
/// <summary> | ||
/// Examples of the media type. | ||
/// </summary> | ||
public IDictionary<string, IOpenApiExample> Examples { get; } | ||
|
||
/// <summary> | ||
/// A map containing the representations for the header. | ||
/// </summary> | ||
public IDictionary<string, OpenApiMediaType> Content { get; } | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
src/Microsoft.OpenApi/Models/Interfaces/IOpenApiSummarizedElement.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Microsoft.OpenApi.Interfaces; | ||
|
||
namespace Microsoft.OpenApi.Models.Interfaces; | ||
/// <summary> | ||
/// Describes an element that has a summary. | ||
/// </summary> | ||
public interface IOpenApiSummarizedElement : IOpenApiElement | ||
{ | ||
/// <summary> | ||
/// Short description for the example. | ||
/// </summary> | ||
public string Summary { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Useless type test Warning
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.
This will be fixed when we migrate the link proxy design pattern implementation to
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.
#2092