web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Connector Development
Answered

How to implement Other Fields (Key-Value) in Open API json

(1) ShareShare
ReportReport
Posted on by
Hello,
 
I wanted to implement a custom connector which will take values dynamically with key value text boxes in the UI (refer below screenshot). 
 
 
I tried to add below properties in the OpenAPI json file but I am getting like below
 
 
 
Below is the sample Json I tried.
 
{
    "swagger": "2.0",
    "info": {
        "title": "Custom Connector",
        "version": "1.0.0"
    },
    "host": "yourhost.com",
    "basePath": "/api",
    "schemes": [
        "https"
    ],
    "consumes": [
        "application/json"
    ],
    "produces": [
        "application/json"
    ],
    "paths": {
        "/createworkitem": {
            "post": {
                "summary": "Create Work Item",
                "operationId": "CreateWorkItem",
                "description": "Create a new work item with optional other fields",
                "parameters": [
                    {
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/CreateWorkItemRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object"
                        }
                    }
                },
                "x-ms-parameters-location": "body"
            }
        }
    },
    "definitions": {
        "CreateWorkItemRequest": {
            "type": "object",
            "properties": {
                "Title": {
                    "type": "string",
                    "description": "Title of the work item"
                },
                "Description": {
                    "type": "string",
                    "description": "Description of the work item"
                },
                "OtherFields": {
                    "type": "array",
                    "description": "Any additional key-value pairs",
                    "additionalProperties": {
                        "type": "string"
                    },
                    "x-ms-visibility": "advanced",
                    "x-ms-summary": "Other Fields"                    
                }
            },
            "required": [
                "Title"
            ]
        }
    }
}
 
I have the same question (0)
  • Verified answer
    Sam_Fawzi Profile Picture
    539 Super User 2025 Season 2 on at
    How to implement Other Fields (Key-Value) in Open API json
    Try to use an object (dictionary), not an array. In Swagger/OpenAPI, dynamic key-value input is modeled with type: object + additionalProperties. Your current OtherFields uses array, and additionalProperties is ignored on arrays.
     
    Fix 
    {
      "swagger": "2.0",
      "info": { "title": "Custom Connector", "version": "1.0.0" },
      "host": "yourhost.com",
      "basePath": "/api",
      "schemes": ["https"],
      "consumes": ["application/json"],
      "produces": ["application/json"],
      "paths": {
        "/createworkitem": {
          "post": {
            "summary": "Create Work Item",
            "operationId": "CreateWorkItem",
            "description": "Create a new work item with optional other fields",
            "parameters": [{
              "name": "body",
              "in": "body",
              "required": true,
              "schema": { "$ref": "#/definitions/CreateWorkItemRequest" }
            }],
            "responses": { "200": { "description": "OK", "schema": { "type": "object" } } },
            "x-ms-parameters-location": "body"
          }
        }
      },
      "definitions": {
        "CreateWorkItemRequest": {
          "type": "object",
          "required": ["Title"],
          "properties": {
            "Title": { "type": "string", "description": "Title of the work item" },
            "Description": { "type": "string", "description": "Description of the work item" },
            "OtherFields": {
              "type": "object",
              "description": "Any additional key-value pairs",
              "additionalProperties": { "type": "string" },
              "x-ms-summary": "Other Fields",
              "x-ms-visibility": "advanced"
            }
          }
        }
      }
    }
     

    This renders in the custom connector designer as an expandable key-value editor where users can add arbitrary keys.
    If your backend expects an array of {key,value} objects
    Model it as:
    "OtherFields": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["key","value"],
        "properties": {
          "key":   { "type": "string" },
          "value": { "type": "string" }
        }
      },
      "x-ms-summary": "Other Fields",
      "x-ms-visibility": "advanced"
    }

    Pick one pattern that matches your API contract:
    Object + additionalProperties -> JSON like "OtherFields": { "Priority":"High", "Owner":"Sam" }
    Array of pairs -> JSON like "OtherFields":[{"key":"Priority","value":"High"}]
  • Suggested answer
    NE-06101621-0 Profile Picture
    on at
    How to implement Other Fields (Key-Value) in Open API json
    Thanks @Sam_Fawzi for sharing your inputs. It is not exactly providing the UI which I am looking for.

    But the suggestion you shared solved my problem. Thanks again.
     
    Array of pairs -> JSON like "OtherFields":[{"key":"Priority","value":"High"}]

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Tom Macfarlan – Community Spotlight

We are honored to recognize Tom Macfarlan as our Community Spotlight for October…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 714 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 519 Moderator

#3
chiaraalina Profile Picture

chiaraalina 317

Last 30 days Overall leaderboard

Featured topics