Skip to content

RequestBody looses parameter name when type is array #378

Closed

Description

When OpenApiV2Deserializer creates RequestBody, the parameter's name when the type is "array".

"put": {
	"tags": [
	  "Users"
	],
	"summary": "Updates a user's list of groups.",
	"description": "Updates the unordered list of group IDs for the specified user.",
	"parameters": [
	  {
		"name": "id",
		"in": "path",
		"description": "The ID of the user.",
		"required": true,
		"type": "string"
	  },
	  {
		"name": "groupIds", // <--------- nowhere to be found
		"in": "body",
		"description": "The unordered list of groups for the specified user.",
		"required": true,
		"schema": {
		  "type": "array",
		  "items": {
			"type": "string"
		  }
		}
	  }
	],
	"responses": { ... }
}

Activity

  1. darrelmiller commented on Feb 2, 2019

    @darrelmiller
    Member

    Yes. This is an unfortunate side effect of the changes made in OpenAPI v3. There is no place for that name in V3. It was dropped because there is no logical place in HTTP for naming a request body. I have discussed this with some folks and we have debated inserting a x-name property in the request body when translating from V2 to V3.

  2. added this to the 1.3 milestone on May 25, 2020
  3. darrelmiller commented on Mar 15, 2021

    @darrelmiller
    Member

    Fixed in #511

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:enhancementEnhancement request targeting an existing experience

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions