Skip to content

Conversation

@Vangaorth
Copy link
Contributor

@Vangaorth Vangaorth commented Dec 4, 2025

Description

patch call support was added without support for body (#280)

Motivation and Context

This PR adds support for body and content-type header when generating a patch call

How Has This Been Tested?

Unit tests

Screenshots (if appropriate):

Types of changes

  • Chore (improvement with no change in the behaviour)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • This PR does not need an update to the documentation.

@Vangaorth Vangaorth requested a review from a team as a code owner December 4, 2025 12:28
@github-actions
Copy link

github-actions bot commented Dec 4, 2025

Jira Pull Request Link

This Pull Request refers to the following Jira issue IOCOM-2842

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 support for request body and Content-Type header handling in PATCH HTTP method operations for OpenAPI v3 specifications. Previously, PATCH was recognized as a supported method but lacked the necessary logic to handle request bodies and set appropriate Content-Type headers.

Key Changes

  • Added "patch" to the SupportedMethod type definition alongside existing methods
  • Updated OpenAPI v3 parser to include "patch" in body parameter and Content-Type header logic
  • Added test cases and mock API endpoints for PATCH operations with request bodies

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/commands/gen-api-models/types.ts Added "patch" to SupportedMethod type union in alphabetical order
src/commands/gen-api-models/parse.v3.ts Extended body parameter parsing and Content-Type header logic to include "patch" method
src/commands/gen-api-models/tests/parse.test.ts Added unit test for parsing PATCH operations with body references
src/commands/gen-api-models/tests/snapshots/index.test.ts.snap Updated snapshots with generated client code for PATCH operations
mocks/openapi_v3/api.yaml Added test endpoint /patch-test-parameter-with-body-ref for OpenAPI v3 spec
mocks/api.yaml Added test endpoint /patch-test-parameter-with-body-ref for OpenAPI v2 spec

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

Copy link

@rodoviti rodoviti left a comment

Choose a reason for hiding this comment

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

LGTM

@gquadrati gquadrati merged commit dbe4784 into master Dec 12, 2025
6 checks passed
@gquadrati gquadrati deleted the feature/patchBodySupport branch December 12, 2025 08:53
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.

3 participants