Skip to content

Commit

Permalink
Replicate copying logic for other component types
Browse files Browse the repository at this point in the history
  • Loading branch information
MaggieKimani1 committed Jan 17, 2025
1 parent 88adb9f commit 962e929
Show file tree
Hide file tree
Showing 11 changed files with 194 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,20 @@ namespace Microsoft.OpenApi.Models.References
/// <summary>
/// Callback Object Reference: A reference to a map of possible out-of band callbacks related to the parent operation.
/// </summary>
public class OpenApiCallbackReference : OpenApiCallback
public class OpenApiCallbackReference : OpenApiCallback, IOpenApiReferenceable
{
#nullable enable
internal OpenApiCallback _target;
private readonly OpenApiReference _reference;

private OpenApiCallback Target
/// <summary>
/// Gets the target callback.
/// </summary>
/// <remarks>
/// If the reference is not resolved, this will return null.
/// </remarks>
public OpenApiCallback Target
#nullable restore
{
get
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,20 @@ namespace Microsoft.OpenApi.Models.References
/// <summary>
/// Example Object Reference.
/// </summary>
public class OpenApiExampleReference : OpenApiExample
public class OpenApiExampleReference : OpenApiExample, IOpenApiReferenceable
{
internal OpenApiExample _target;
private readonly OpenApiReference _reference;
private string _summary;
private string _description;

private OpenApiExample Target
/// <summary>
/// Gets the target example.
/// </summary>
/// <remarks>
/// If the reference is not resolved, this will return null.
/// </remarks>
public OpenApiExample Target
{
get
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@ namespace Microsoft.OpenApi.Models.References
/// <summary>
/// Header Object Reference.
/// </summary>
public class OpenApiHeaderReference : OpenApiHeader
public class OpenApiHeaderReference : OpenApiHeader, IOpenApiReferenceable
{
internal OpenApiHeader _target;
private readonly OpenApiReference _reference;
private string _description;

private OpenApiHeader Target
/// <summary>
/// Gets the target header.
/// </summary>
/// <remarks>
/// If the reference is not resolved, this will return null.
/// </remarks>
public OpenApiHeader Target
{
get
{
Expand Down
10 changes: 8 additions & 2 deletions src/Microsoft.OpenApi/Models/References/OpenApiLinkReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ namespace Microsoft.OpenApi.Models.References
/// <summary>
/// Link Object Reference.
/// </summary>
public class OpenApiLinkReference : OpenApiLink
public class OpenApiLinkReference : OpenApiLink, IOpenApiReferenceable
{
internal OpenApiLink _target;
private readonly OpenApiReference _reference;
private string _description;

private OpenApiLink Target
/// <summary>
/// Gets the target link.
/// </summary>
/// <remarks>
/// If the reference is not resolved, this will return null.
/// </remarks>
public OpenApiLink Target
{
get
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,21 @@ namespace Microsoft.OpenApi.Models.References
/// <summary>
/// Parameter Object Reference.
/// </summary>
public class OpenApiParameterReference : OpenApiParameter
public class OpenApiParameterReference : OpenApiParameter, IOpenApiReferenceable
{
internal OpenApiParameter _target;
private readonly OpenApiReference _reference;
private string _description;
private bool? _explode;
private ParameterStyle? _style;

private OpenApiParameter Target
/// <summary>
/// Gets the target parameter.
/// </summary>
/// <remarks>
/// If the reference is not resolved, this will return null.
/// </remarks>
public OpenApiParameter Target
{
get
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,20 @@ namespace Microsoft.OpenApi.Models.References
/// <summary>
/// Path Item Object Reference: to describe the operations available on a single path.
/// </summary>
public class OpenApiPathItemReference : OpenApiPathItem
public class OpenApiPathItemReference : OpenApiPathItem, IOpenApiReferenceable
{
internal OpenApiPathItem _target;
private readonly OpenApiReference _reference;
private string _description;
private string _summary;

private OpenApiPathItem Target
/// <summary>
/// Gets the target path item.
/// </summary>
/// <remarks>
/// If the reference is not resolved, this will return null.
/// </remarks>
public OpenApiPathItem Target
{
get
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ namespace Microsoft.OpenApi.Models.References
/// <summary>
/// Request Body Object Reference.
/// </summary>
public class OpenApiRequestBodyReference : OpenApiRequestBody
public class OpenApiRequestBodyReference : OpenApiRequestBody, IOpenApiReferenceable
{
internal OpenApiRequestBody _target;
private readonly OpenApiReference _reference;
private string _description;

private OpenApiRequestBody Target
/// <summary>
/// Gets the target request body.
/// </summary>
/// <remarks>
/// If the reference is not resolved, this will return null.
/// </remarks>
public OpenApiRequestBody Target
{
get
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ namespace Microsoft.OpenApi.Models.References
/// <summary>
/// Response Object Reference.
/// </summary>
public class OpenApiResponseReference : OpenApiResponse
public class OpenApiResponseReference : OpenApiResponse, IOpenApiReferenceable
{
internal OpenApiResponse _target;
private readonly OpenApiReference _reference;
private string _description;

private OpenApiResponse Target
/// <summary>
/// Gets the target response.
/// </summary>
/// <remarks>
/// If the reference is not resolved, this will return null.
/// </remarks>
public OpenApiResponse Target
{
get
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Microsoft.OpenApi.Models.References
/// <summary>
/// Schema reference object
/// </summary>
public class OpenApiSchemaReference : OpenApiSchema
public class OpenApiSchemaReference : OpenApiSchema, IOpenApiReferenceable
{
#nullable enable
private OpenApiSchema? _target;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ namespace Microsoft.OpenApi.Models.References
/// <summary>
/// Security Scheme Object Reference.
/// </summary>
public class OpenApiSecuritySchemeReference : OpenApiSecurityScheme
public class OpenApiSecuritySchemeReference : OpenApiSecurityScheme, IOpenApiReferenceable
{
internal OpenApiSecurityScheme _target;
private readonly OpenApiReference _reference;
private string _description;

private OpenApiSecurityScheme Target
/// <summary>
/// Gets the target security scheme.
/// </summary>
/// <remarks>
/// If the reference is not resolved, this will return null.
/// </remarks>
public OpenApiSecurityScheme Target
{
get
{
Expand Down
Loading

0 comments on commit 962e929

Please sign in to comment.