Skip to content

Commit 7212938

Browse files
Fix simple mistake in config and OpenAPI
1 parent eba4a8d commit 7212938

File tree

6 files changed

+35
-13
lines changed

6 files changed

+35
-13
lines changed

backend/src/Squidex.Data.MongoDb/ServiceExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public static void AddSquidexMongoStore(this IServiceCollection services, IConfi
228228
shardKey => ActivatorUtilities.CreateInstance<AtlasTextIndex>(c, shardKey));
229229
}).AsOptional<ITextIndex>().As<IDeleter>();
230230
}
231-
else if (config.GetValue<bool>("store:mongoDb:dpcumentDb"))
231+
else if (config.GetValue<bool>("store:mongoDb:documentDb"))
232232
{
233233
services.AddSingletonAs(c =>
234234
{

backend/src/Squidex/Areas/Api/Controllers/Contents/ContentsSharedController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public IActionResult PostGraphQLBatch(string app)
142142
[AcceptHeader.Unpublished]
143143
public async Task<IActionResult> GetAllContents(string app, AllContentsByGetDto query)
144144
{
145-
var contents = await contentQuery.QueryAsync(Context, (query ?? new AllContentsByGetDto()).ToQuery(Request), HttpContext.RequestAborted);
145+
var contents = await contentQuery.QueryAsync(Context, query?.ToQuery(Request) ?? Q.Empty, HttpContext.RequestAborted);
146146

147147
var response = Deferred.AsyncResponse(() =>
148148
{

backend/src/Squidex/Areas/Api/Controllers/Contents/Generator/OperationBuilder.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,19 @@ private OperationBuilder AddParameter(string name, JsonSchema schema, OpenApiPar
8282

8383
public OperationBuilder HasQueryOptions(bool supportSearch)
8484
{
85-
operation.AddQuery(true);
86-
85+
operation.AddQuery(supportSearch);
8786
return this;
8887
}
8988

9089
public OperationBuilder Deprecated()
9190
{
9291
operation.IsDeprecated = true;
93-
9492
return this;
9593
}
9694

97-
public OperationBuilder HasQuery(string name, JsonObjectType type, string description)
95+
public OperationBuilder HasQuery(string name, JsonObjectType type, string description, string? format = null)
9896
{
99-
var jsonSchema = new JsonSchema { Type = type };
97+
var jsonSchema = new JsonSchema { Type = type, Format = format };
10098

10199
return AddParameter(name, jsonSchema, OpenApiParameterKind.Query, description);
102100
}

backend/src/Squidex/Areas/Api/Controllers/Contents/Generator/SchemasOpenApiGenerator.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ private static void GenerateSharedOperations(OperationsBuilder builder)
7979
.RequirePermission(PermissionIds.AppContentsReadOwn)
8080
.Operation("Query")
8181
.OperationSummary("Query contents across all schemas.")
82-
.HasQuery("ids", JsonObjectType.String, "Comma-separated list of content IDs.")
82+
.HasQueryOptions(true)
83+
.HasQuery("referencing", JsonObjectType.String, "The ID of the referencing content item.")
84+
.HasQuery("references", JsonObjectType.String, "The ID of the reference content item.")
85+
.HasQuery("scheduledFrom", JsonObjectType.String, "The start time of the scheduled content period (see scheduledTo)", JsonFormatStrings.DateTime)
86+
.HasQuery("scheduledTo", JsonObjectType.String, " The end time of the scheduled content period (see scheduledFrom).", JsonFormatStrings.DateTime)
8387
.Responds(200, "Content items retrieved.", builder.ContentsSchema)
8488
.Responds(400, "Query not valid.");
8589

backend/src/Squidex/Areas/Api/Controllers/Contents/Models/AllContentsByGetDto.cs

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,35 @@ public sealed class AllContentsByGetDto
2525
public string? Ids { get; set; }
2626

2727
/// <summary>
28-
/// The start of the schedule.
28+
/// The start time of the scheduled content period (see scheduleTo).
2929
/// </summary>
3030
[FromQuery(Name = "scheduleFrom")]
31-
public Instant? ScheduledFrom { get; set; }
31+
[Obsolete("Renamed to 'scheduledFrom'")]
32+
public Instant? ScheduleFrom
33+
{
34+
set => ScheduledFrom = value;
35+
}
3236

3337
/// <summary>
34-
/// The end of the schedule.
38+
/// The start time of the scheduled content period (see scheduleFrom).
3539
/// </summary>
3640
[FromQuery(Name = "scheduleTo")]
41+
[Obsolete("Renamed to 'scheduledTo'")]
42+
public Instant? ScheduleTo
43+
{
44+
set => ScheduledTo = value;
45+
}
46+
47+
/// <summary>
48+
/// The start time of the scheduled content period (see scheduledTo).
49+
/// </summary>
50+
[FromQuery(Name = "scheduledFrom")]
51+
public Instant? ScheduledFrom { get; set; }
52+
53+
/// <summary>
54+
/// The end time of the scheduled content period (see scheduledFrom).
55+
/// </summary>
56+
[FromQuery(Name = "scheduledTo")]
3757
public Instant? ScheduledTo { get; set; }
3858

3959
/// <summary>

backend/src/Squidex/Areas/Api/Controllers/Contents/Models/AllContentsByPostDto.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ public sealed class AllContentsByPostDto
2525
public DomainId[]? Ids { get; set; }
2626

2727
/// <summary>
28-
/// The start of the schedule.
28+
/// The start time of the scheduled content period (see scheduledTo).
2929
/// </summary>
3030
public Instant? ScheduledFrom { get; set; }
3131

3232
/// <summary>
33-
/// The end of the schedule.
33+
/// The end time of the scheduled content period (see scheduledFrom).
3434
/// </summary>
3535
public Instant? ScheduledTo { get; set; }
3636

0 commit comments

Comments
 (0)