Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3.22.0 #108

Merged
merged 2 commits into from
Jul 16, 2024
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Represents the **NuGet** versions.

## v3.22.0
- *Enhancement:* Identifier parsing and `CompositeKey` formatting moved to the `CosmosDbArgs` to enable overriding where required.
- *Enhancement:* Cosmos model constraint softened to allow for `IEntityKey` to support more flexible identifier scenarios.
- *Enhancement:* All Cosmos methods updated to support `CompositeKey` versus `object` for identifier specification for greater flexibility.
- *Enhancement:* `CosmosDbModelContainer` and `CosmosDbValueModelContainer` enable model-only access; also, all model capabilities housed under new `Model` namespace.
- *Fixed:* `PagingOperationFilter` correctly specifies a format of `int64` for the `number`-type paging parameters.
- *Fixed:* `CompositeKey` correctly supports `IReferenceData` types leveraging the underlying `IReferenceData.Code`.

## v3.21.1
- *Fixed:* `Mapper.MapSameTypeWithSourceValue` added (defaults to `true`) to map the source value to the destination value where the types are the same; previously this would result in an exception unless added explicitly. The `Mapper.SameTypeMapper` enables.
- *Fixed:* `ReferenceDataOrchestrator.GetAllTypesInNamespace` added to get all the `IReferenceData` types in the specified namespace. Needed for the likes of the `CosmosDbBatch.ImportValueBatchAsync` where a list of types is required.
Expand Down
2 changes: 1 addition & 1 deletion Common.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>3.21.1</Version>
<Version>3.22.0</Version>
<LangVersion>preview</LangVersion>
<Authors>Avanade</Authors>
<Company>Avanade</Company>
Expand Down
12 changes: 6 additions & 6 deletions src/CoreEx.AspNetCore/WebApis/PagingOperationFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ public void Apply(OpenApiOperation operation, OperationFilterContext context)
return;

if (Fields.HasFlag(PagingOperationFilterFields.Skip))
operation.Parameters.Add(CreateParameter(HttpConsts.PagingArgsSkipQueryStringName, "The specified number of elements in a sequence to bypass.", "number"));
operation.Parameters.Add(CreateParameter(HttpConsts.PagingArgsSkipQueryStringName, "The specified number of elements in a sequence to bypass.", "number", "int64"));

if (Fields.HasFlag(PagingOperationFilterFields.Page))
operation.Parameters.Add(CreateParameter(HttpConsts.PagingArgsPageQueryStringName, "The page number for the elements in a sequence to select.", "number"));
operation.Parameters.Add(CreateParameter(HttpConsts.PagingArgsPageQueryStringName, "The page number for the elements in a sequence to select.", "number", "int64"));

if (Fields.HasFlag(PagingOperationFilterFields.Token))
operation.Parameters.Add(CreateParameter(HttpConsts.PagingArgsTokenQueryStringName, "The token to get the next page of elements.", "string"));

if (Fields.HasFlag(PagingOperationFilterFields.Take))
operation.Parameters.Add(CreateParameter(HttpConsts.PagingArgsTakeQueryStringName, "The specified number of contiguous elements from the start of a sequence.", "number"));
operation.Parameters.Add(CreateParameter(HttpConsts.PagingArgsTakeQueryStringName, "The specified number of contiguous elements from the start of a sequence.", "number", "int64"));

if (Fields.HasFlag(PagingOperationFilterFields.Size))
operation.Parameters.Add(CreateParameter(HttpConsts.PagingArgsSizeQueryStringName, "The page size being the specified number of contiguous elements from the start of a sequence.", "number"));
operation.Parameters.Add(CreateParameter(HttpConsts.PagingArgsSizeQueryStringName, "The page size being the specified number of contiguous elements from the start of a sequence.", "number", "int64"));

if (Fields.HasFlag(PagingOperationFilterFields.Count))
operation.Parameters.Add(CreateParameter(HttpConsts.PagingArgsCountQueryStringName, "Indicates whether to get the total count when performing the underlying query.", "boolean"));
Expand All @@ -67,13 +67,13 @@ public void Apply(OpenApiOperation operation, OperationFilterContext context)
/// <summary>
/// Create the parameter definition.
/// </summary>
private static OpenApiParameter CreateParameter(string name, string description, string typeName) => new()
private static OpenApiParameter CreateParameter(string name, string description, string typeName, string? format = null) => new()
{
Name = name,
Description = description,
In = ParameterLocation.Query,
Required = false,
Schema = new OpenApiSchema { Type = typeName }
Schema = new OpenApiSchema { Type = typeName, Format = format }
};
}
}
Loading
Loading