-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathODataConstants.cs
More file actions
51 lines (45 loc) · 2.02 KB
/
ODataConstants.cs
File metadata and controls
51 lines (45 loc) · 2.02 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
41
42
43
44
45
46
47
48
49
50
51
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
// ------------------------------------------------------------
using System;
using System.Collections.Generic;
namespace Microsoft.OpenApi.OData
{
internal static class ODataConstants
{
/// <summary>
/// Namespaces used in standard included models.
/// </summary>
public readonly static List<string> StandardNamespaces =
[
"Org.OData.",
"Edm",
"OData.Community.",
];
/// <summary>
/// @odata.nextLink KeyValue pair
/// </summary>
public readonly static KeyValuePair<string, IOpenApiSchema> OdataNextLink = new("@odata.nextLink", new OpenApiSchema { Type = JsonSchemaType.String | JsonSchemaType.Null });
/// <summary>
/// @odata.count KeyValue pair
/// </summary>
[Obsolete("Use CreateOdataCount instead to specify the format of the count value.")]
public readonly static KeyValuePair<string, IOpenApiSchema> OdataCount = new("@odata.count", new OpenApiSchema { Type = JsonSchemaType.Number | JsonSchemaType.Null, Format = "int64"});
/// <summary>
/// Creates an @odata.count KeyValue pair with the specified format.
/// </summary>
public static KeyValuePair<string, IOpenApiSchema> CreateOdataCount(bool useInt32Format)
{
return new("@odata.count", new OpenApiSchema
{
Type = JsonSchemaType.Number | JsonSchemaType.Null,
Format = useInt32Format ? "int32" : "int64"
});
}
/// <summary>
/// @odata.deltaLink KeyValue pair
/// </summary>
public readonly static KeyValuePair<string, IOpenApiSchema> OdataDeltaLink = new("@odata.deltaLink", new OpenApiSchema { Type = JsonSchemaType.String | JsonSchemaType.Null });
}
}