Skip to content

Commit

Permalink
V3.22.0 (#108)
Browse files Browse the repository at this point in the history
* v3.22.0
- *Enhancement:* Identifier formatting and parsing moved to the `CosmosDbArgs` to enable overriding where required.
- *Enhancement:* Cosmos model constraint softened to allow for `IEntityKey` to support more flexible scenarios.
- *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`.

* - *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`.
  • Loading branch information
chullybun committed Jul 16, 2024
1 parent cb9ed1d commit 20fac3b
Show file tree
Hide file tree
Showing 35 changed files with 1,524 additions and 969 deletions.
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

0 comments on commit 20fac3b

Please sign in to comment.