Skip to content

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

Merged
gavinbarron merged 2 commits intomainfrom
feature/int32-format-config-options
Mar 18, 2026
Merged

feat: add int32 format configuration for pagination parameters and count responses#793
gavinbarron merged 2 commits 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
@gavinbarron gavinbarron enabled auto-merge (squash) March 18, 2026 00:58
@sonarqubecloud
Copy link

Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for making the changes!

@gavinbarron gavinbarron merged commit 0dd9445 into main Mar 18, 2026
38 of 41 checks passed
@gavinbarron gavinbarron deleted the feature/int32-format-config-options branch March 18, 2026 16:32
baywet pushed a commit that referenced this pull request Mar 18, 2026
…unt responses (#793)

Add two new boolean settings to OpenApiConvertSettings:
- UseInt32ForPaginationParameters: when true, generates $top and $skip
  parameters with int32 format instead of the default int64
- UseInt32ForCountResponses: when true, generates $count 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 added a commit that referenced this pull request Mar 19, 2026
…n-to-v2

feat: add int32 format configuration for pagination parameters and count responses (#793)
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

2 participants