Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #641
Closed
Open
Issue created Jul 25, 2018 by Administrator@rootContributor

PHP - pass array(key-value pair) as an argument instead of comma separated individual arguments

Created by: rajanmodi

Description

Functions generated automatically in SDK should support array(key-value pair) as an argument.

Suppose there is search function with 66 arguments. search($this->arg1 = null, $this->arg2 = null, ...., $this->arg66 = null)

When we need to make a call to this search function ,we need to provide all the arguments $apiInstance->search($this->arg1 = 5, $this->arg2 = 10, $this->arg3 = 20,.....,$this->arg66 = 1)

What if I only want to pass only two arguments $apiInstance->search($this->arg1 = 5,$this->arg31 = 95). now this will assign 5 to arg1 and 95 to arg2. I need to assign value of 95 to arg31

I think solution will be generating function argument as an array with key-value pair for such cases .

Instead of keeping comma separated arguments, array should be there..

openapi-generator version
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
Assignee
Assign to
Time tracking