Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/Microsoft.OpenApi.Readers/ParseNodes/AnyFieldMap.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

using System.Collections.Generic;

namespace Microsoft.OpenApi.Readers.ParseNodes
{
internal class AnyFieldMap<T> : Dictionary<string, AnyFieldMapParameter<T>>
{
}
}
40 changes: 40 additions & 0 deletions src/Microsoft.OpenApi.Readers/ParseNodes/AnyFieldMapParameter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

using System;
using Microsoft.OpenApi.Any;
using Microsoft.OpenApi.Models;

namespace Microsoft.OpenApi.Readers.ParseNodes
{
internal class AnyFieldMapParameter<T>
{
/// <summary>
/// Constructor.
/// </summary>
public AnyFieldMapParameter(
Func<T, IOpenApiAny> propertyGetter,
Action<T, IOpenApiAny> propertySetter,
Func<T, OpenApiSchema> schemaGetter)
{
this.PropertyGetter = propertyGetter;
this.PropertySetter = propertySetter;
this.SchemaGetter = schemaGetter;
}

/// <summary>
/// Function to retrieve the value of the property.
/// </summary>
public Func<T, IOpenApiAny> PropertyGetter { get; }

/// <summary>
/// Function to set the value of the property.
/// </summary>
public Action<T, IOpenApiAny> PropertySetter { get; }

/// <summary>
/// Function to get the schema to apply to the property.
/// </summary>
public Func<T, OpenApiSchema> SchemaGetter { get; }
}
}
12 changes: 12 additions & 0 deletions src/Microsoft.OpenApi.Readers/ParseNodes/AnyListFieldMap.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

using System.Collections.Generic;

namespace Microsoft.OpenApi.Readers.ParseNodes
{
internal class AnyListFieldMap<T> : Dictionary<string, AnyListFieldMapParameter<T>>
{

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

using System;
using System.Collections.Generic;
using Microsoft.OpenApi.Any;
using Microsoft.OpenApi.Models;

namespace Microsoft.OpenApi.Readers.ParseNodes
{
internal class AnyListFieldMapParameter<T>
{
/// <summary>
/// Constructor
/// </summary>
public AnyListFieldMapParameter(
Func<T, IList<IOpenApiAny>> propertyGetter,
Action<T, IList<IOpenApiAny>> propertySetter,
Func<T, OpenApiSchema> schemaGetter)
{
this.PropertyGetter = propertyGetter;
this.PropertySetter = propertySetter;
this.SchemaGetter = schemaGetter;
}

/// <summary>
/// Function to retrieve the value of the property.
/// </summary>
public Func<T, IList<IOpenApiAny>> PropertyGetter { get; }

/// <summary>
/// Function to set the value of the property.
/// </summary>
public Action<T, IList<IOpenApiAny>> PropertySetter { get; }

/// <summary>
/// Function to get the schema to apply to the property.
/// </summary>
public Func<T, OpenApiSchema> SchemaGetter { get; }
}
}
12 changes: 12 additions & 0 deletions src/Microsoft.OpenApi.Readers/ParseNodes/AnyMapFieldMap.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

using System.Collections.Generic;

namespace Microsoft.OpenApi.Readers.ParseNodes
{
internal class AnyMapFieldMap<T, U> : Dictionary<string, AnyMapFieldMapParameter<T, U>>
{

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

using System;
using System.Collections.Generic;
using Microsoft.OpenApi.Any;
using Microsoft.OpenApi.Interfaces;
using Microsoft.OpenApi.Models;

namespace Microsoft.OpenApi.Readers.ParseNodes
{
internal class AnyMapFieldMapParameter<T, U>
{
/// <summary>
/// Constructor
/// </summary>
public AnyMapFieldMapParameter(
Func<T, IDictionary<string, U>> propertyMapGetter,
Func<U, IOpenApiAny> propertyGetter,
Action<U, IOpenApiAny> propertySetter,
Func<T, OpenApiSchema> schemaGetter)
{
this.PropertyMapGetter = propertyMapGetter;
this.PropertyGetter = propertyGetter;
this.PropertySetter = propertySetter;
this.SchemaGetter = schemaGetter;
}

/// <summary>
/// Function to retrieve the property that is a map from string to an inner element containing IOpenApiAny.
/// </summary>
public Func<T, IDictionary<string, U>> PropertyMapGetter { get; }

/// <summary>
/// Function to retrieve the value of the property from an inner element.
/// </summary>
public Func<U, IOpenApiAny> PropertyGetter { get; }

/// <summary>
/// Function to set the value of the property.
/// </summary>
public Action<U, IOpenApiAny> PropertySetter { get; }

/// <summary>
/// Function to get the schema to apply to the property.
/// </summary>
public Func<T, OpenApiSchema> SchemaGetter { get; }
}
}
Loading