Skip to content

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

Merged
Gavin Barron (gavinbarron) merged 2 commits into
mainfrom
feature/int32-format-config-options
Mar 18, 2026
Merged

feat: add int32 format configuration for pagination parameters and count responses#793
Gavin Barron (gavinbarron) merged 2 commits into
mainfrom
feature/int32-format-config-options

Conversation

@gavinbarron

@gavinbarronGavin Barron (gavinbarron) commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

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

FileChange
OpenApiConvertSettings.csAdded 2 new bool properties + Clone()
OpenApiParameterGenerator.csCreateTop/CreateSkip respect new setting
OpenApiSchemaGenerator.cs`` schema + @odata.count in collections respect new setting
OpenApiResponseGenerator.cs@odata.count in responses respects new setting
ODataConstants.csAdded CreateOdataCount() helper for configurable format
PublicAPI.Unshipped.txtDeclared 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>
Comment threadsrc/Microsoft.OpenApi.OData.Reader/OData/ODataConstants.cs
@sonarqubecloud

Copy link
Copy Markdown

@baywetVincent Biret (baywet) left a comment

Copy link
Copy Markdown
Member

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
Gavin Barron (gavinbarron) merged commit 0dd9445 into mainMar 18, 2026
38 of 41 checks passed
@gavinbarron
Gavin Barron (gavinbarron) deleted the feature/int32-format-config-options branch March 18, 2026 16:32
Vincent Biret (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>
Vincent Biret (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 freeto 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

@gavinbarron@baywet