Skip to content

feat: add int32 format configuration for pagination parameters and count responses#793

Open
gavinbarron wants to merge 1 commit intomainfrom
feature/int32-format-config-options
Open

feat: add int32 format configuration for pagination parameters and count responses#793
gavinbarron wants to merge 1 commit intomainfrom
feature/int32-format-config-options

Conversation

@gavinbarron
Copy link
Contributor

@gavinbarron gavinbarron commented Mar 18, 2026

Summary

Adds two new boolean settings to OpenApiConvertSettings:

  • UseInt32ForPaginationParameters: when true, generates $skip and $top parameters with int32 format instead of the default int64
  • UseInt32ForCountResponses: when true, generates the $count response schema and @odata.count properties with int32 format instead of int64

Both default to false, preserving existing behavior. They are configured via the HIDI settings config file:

{
  "OpenApiConvertSettings": {
    "UseInt32ForPaginationParameters": true,
    "UseInt32ForCountResponses": true
  }
}

Changes

File Change
OpenApiConvertSettings.cs Added 2 new bool properties + Clone()
OpenApiParameterGenerator.cs CreateTop/CreateSkip respect new setting
OpenApiSchemaGenerator.cs `` schema + @odata.count in collections respect new setting
OpenApiResponseGenerator.cs @odata.count in responses respects new setting
ODataConstants.cs Added CreateOdataCount() helper for configurable format
PublicAPI.Unshipped.txt Declared new public API surface
Test files (x2) Theory tests covering both true/false cases

Testing

All 1267 existing tests pass. 4 new test cases added covering both format options.

Closes #792

…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>
@gavinbarron gavinbarron requested a review from a team as a code owner March 18, 2026 00:54
@sonarqubecloud
Copy link

@gavinbarron gavinbarron enabled auto-merge (squash) March 18, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

$skip and $top parameters and $count responses are set to int64 format

1 participant