feat: add int32 format configuration for pagination parameters and count responses#793
Open
gavinbarron wants to merge 1 commit intomainfrom
Open
feat: add int32 format configuration for pagination parameters and count responses#793gavinbarron wants to merge 1 commit intomainfrom
gavinbarron wants to merge 1 commit intomainfrom
Conversation
…unt responses Add two new boolean settings to OpenApiConvertSettings: - UseInt32ForPaginationParameters: when true, generates \ and \ parameters with int32 format instead of the default int64 - UseInt32ForCountResponses: when true, generates \ response schema and @odata.count properties with int32 format instead of int64 Both settings default to false, preserving existing behavior. They are configured via the HIDI settings config file under OpenApiConvertSettings. Closes #792 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
baywet
requested changes
Mar 18, 2026
| @@ -29,6 +29,18 @@ internal static class ODataConstants | |||
| /// </summary> | |||
| public readonly static KeyValuePair<string, IOpenApiSchema> OdataCount = new("@odata.count", new OpenApiSchema { Type = JsonSchemaType.Number | JsonSchemaType.Null, Format = "int64"}); | |||
Member
There was a problem hiding this comment.
shouldn't this have been marked as obsolete?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Adds two new boolean settings to
OpenApiConvertSettings:UseInt32ForPaginationParameters: whentrue, generates$skipand$topparameters withint32format instead of the defaultint64UseInt32ForCountResponses: whentrue, generates the$countresponse schema and@odata.countproperties withint32format instead ofint64Both default to
false, preserving existing behavior. They are configured via the HIDI settings config file:{ "OpenApiConvertSettings": { "UseInt32ForPaginationParameters": true, "UseInt32ForCountResponses": true } }Changes
OpenApiConvertSettings.csClone()OpenApiParameterGenerator.csCreateTop/CreateSkiprespect new settingOpenApiSchemaGenerator.cs@odata.countin collections respect new settingOpenApiResponseGenerator.cs@odata.countin responses respects new settingODataConstants.csCreateOdataCount()helper for configurable formatPublicAPI.Unshipped.txtTesting
All 1267 existing tests pass. 4 new test cases added covering both format options.
Closes #792