mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1.2 KiB
29 lines
1.2 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using NJsonSchema;
|
|
using NSwag;
|
|
using Squidex.Pipeline.OpenApi;
|
|
|
|
namespace Squidex.Areas.Api.Config.OpenApi
|
|
{
|
|
public static class ODataExtensions
|
|
{
|
|
public static void AddOData(this OpenApiOperation operation, string entity, bool supportSearch)
|
|
{
|
|
if (supportSearch)
|
|
{
|
|
operation.AddQuery("$search", JsonObjectType.String, "Optional OData full text search.");
|
|
}
|
|
|
|
operation.AddQuery("$top", JsonObjectType.Integer, $"Optional number of {entity} to take.");
|
|
operation.AddQuery("$skip", JsonObjectType.Integer, $"Optional number of {entity} to skip.");
|
|
operation.AddQuery("$orderby", JsonObjectType.String, "Optional OData order definition.");
|
|
operation.AddQuery("$filter", JsonObjectType.String, "Optional OData filter definition.");
|
|
}
|
|
}
|
|
}
|
|
|