Content-Type Mismatch in API Call

Hi,

I’ve been working on an action integration to allow me to work with the Azure DevOps APIs. Most actions work, however any action that requires the application/json-patch+json Content-Type is failing.

Expected Result:
The user story should be created successfully without any content type errors.

Actual Result:
The request fails with a VssRequestContentTypeNotSupportedException. The error message returned is:
“The request indicated a Content-Type of ‘application/json’ for method type ‘POST’ which is not supported. Valid content types for this method are: application/json-patch+json.” The GPT recognises the error, and tries again, but always fails. Here is my OpenAPI spec:

paths:
/xxxxxxxxx/_apis/wit/workitems/$user story:
patch:
summary: Create a new user story
operationId: createUserStory
parameters:
- name: api-version
in: query
description: The version of the API to use
required: true
schema:
type: string
enum: [“7.1-preview.3”]
requestBody:
description: The user story to create
required: true
content:
application/json-patch+json:
schema:
type: array
items:
$ref: “#/components/schemas/WorkItemPatchOperation”
responses:
“200”:
description: Successful response
content:
application/json:
schema:
$ref: “#/components/schemas/WorkItem”

Any ideas? I’ve tried adding clear instructions to the GPT but that’s not worked either.

Having the same issue. Where you able to resolve?

I try also to create a workitem in Devops with action GPT and I’ve also the same error. I’ve executed successfully the create with a swagger :

requestBody:
        required: true
        description: JSON Patch document containing the fields and values to create the Work Item.
        content:
          application/json-patch+json:
            schema:
              type: array
              items:
                type: object
                properties:
                  op:
                    type: string
                    description: The operation to perform (e.g., "add").
                    enum:
                      - add
                  path:
                    type: string
                    description: The path to the field being updated (e.g., "/fields/System.Title").
                  value:
                    type: string
                    description: The value to set for the field.
                required:
                  - op
                  - path
                  - value
            example:
              - op: add
                path: /fields/System.Title
                value: "Feature Implementation"
              - op: add
                path: /fields/System.Description
                value: "Implement a feature to manage unique statuses for educational degrees."