Forum Discussion

yulshimi's avatar
yulshimi
New Member
5 months ago

Is it possible to modify a value of the request body property in OpenAPI specification?

"/hello/members/": {
      "post": {
        "summary": "HelloWorld",
        "description": "HelloWorld",
        "operationId": "HelloWorld",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "MyId"
              ],
              "type": "object",
              "properties": {
                "MyId": {
                  "description": "HelloWorld",
                  "type": "string",
                  "x-ms-summary": "UserId",
                  "x-ms-visibility": "important"
                }
              },
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        },
        "deprecated": false,
      }
    },

In this OpenAPI speficiation (Swagger), there is a property "MyId" in the request body. I wonder if it is possible to manipulate the value of "MyId" in this document.

For example, I'd like to append another string "Hello" to the value of "MyId" so if the value of "MyId" is "World", "HelloWorld" is going to be the one that is actually put inside of the request body before making a HTTP POST request. 

No RepliesBe the first to reply