Skip to content

feature/fesd-615_response_ordering#99

Merged
PrincessMadMath merged 7 commits intomainfrom
feature/fesd-615_response_ordering
Dec 11, 2025
Merged

feature/fesd-615_response_ordering#99
PrincessMadMath merged 7 commits intomainfrom
feature/fesd-615_response_ordering

Conversation

@PrincessMadMath
Copy link
Contributor

@PrincessMadMath PrincessMadMath commented Dec 11, 2025

Jira issue link: fesd-615



Description of changes

Add deterministic ordering of response.

Additional checks

  • Updated the documentation of the project to reflect the changes
  • Added new tests that cover the code changes

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds deterministic ordering of responses in OpenAPI document generation to ensure consistent output for better source control diffs and predictable documentation. The implementation sorts responses by HTTP status code, addressing an issue where responses from controller-level and method-level attributes were being added in processing order rather than by status code.

Key Changes:

  • Introduced OrderResponseFilter to sort OpenAPI responses by status code
  • Added comprehensive test case demonstrating the ordering fix with controller-level ProducesResponseType attributes
  • Updated response descriptions for HTTP status codes 202 and 204 to use standard descriptions ("Accepted" and "No Content")

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Workleap.Extensions.OpenAPI/Ordering/OrderResponseFilter.cs New document filter that sorts paths, operations, and responses by status code for deterministic output
src/Workleap.Extensions.OpenAPI/Builder/OpenApiBuilder.cs Registers the new OrderResponseFilter in the Swagger configuration
src/tests/WebApi.OpenAPI.SystemTest/Ordering/OrderingController.cs New test controller demonstrating the ordering fix for multiple response types
src/tests/WebApi.OpenAPI.SystemTest/ExtractTypeResult/TypedResultProperContentTypeController.cs Added NoContent test case to verify proper handling of 204 responses
src/tests/expected-openapi-document.yaml Updated expected output showing properly ordered responses and corrected status code descriptions
src/tests/WebApi.OpenAPI.SystemTest/openapi-v1.yaml Mirror of expected output for system test verification
README.md Updated documentation to list the new ordering feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@PrincessMadMath PrincessMadMath merged commit f3361fe into main Dec 11, 2025
10 checks passed
@PrincessMadMath PrincessMadMath deleted the feature/fesd-615_response_ordering branch December 11, 2025 21:02
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.

2 participants