forked from microsoft/OpenAPI.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIOpenApiVersionService.cs
More file actions
40 lines (36 loc) · 1.74 KB
/
IOpenApiVersionService.cs
File metadata and controls
40 lines (36 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Reader.ParseNodes;
namespace Microsoft.OpenApi.Interfaces
{
/// <summary>
/// Interface to a version specific parsing implementations.
/// </summary>
internal interface IOpenApiVersionService
{
/// <summary>
/// Loads an OpenAPI Element from a document fragment
/// </summary>
/// <typeparam name="T">Type of element to load</typeparam>
/// <param name="node">document fragment node</param>
/// <param name="doc">A host document instance.</param>
/// <returns>Instance of OpenAPIElement</returns>
T? LoadElement<T>(ParseNode node, OpenApiDocument doc) where T : IOpenApiElement;
/// <summary>
/// Converts a generic RootNode instance into a strongly typed OpenApiDocument
/// </summary>
/// <param name="rootNode">RootNode containing the information to be converted into an OpenAPI Document</param>
/// <param name="location">Location of where the document that is getting loaded is saved</param>
/// <returns>Instance of OpenApiDocument populated with data from rootNode</returns>
OpenApiDocument LoadDocument(RootNode rootNode, Uri location);
/// <summary>
/// Gets the description and summary scalar values in a reference object for V3.1 support
/// </summary>
/// <param name="mapNode">A YamlMappingNode.</param>
/// <param name="scalarValue">The scalar value we're parsing.</param>
/// <returns>The resulting node value.</returns>
string? GetReferenceScalarValues(MapNode mapNode, string scalarValue);
}
}