Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter Sets #1671

Closed
programster opened this issue Oct 12, 2015 · 3 comments
Closed

Parameter Sets #1671

programster opened this issue Oct 12, 2015 · 3 comments

Comments

@programster
Copy link

My POST and PUTS requests usually have the exact same set of parameters. However I cannot create a re-usable set, only create named parameters and then reference those over and over again. E.g. the current system works as follows

"paths": {
  "/stuff": {
    "get": {
      "description": "Gets stuff",
      "operationId": "getStuff",
      "parameters": [
        {
          "$ref": "#/parameters/param1"
        },
        {
          "$ref": "#/parameters/param2"
        }
      ]
    }
  }
}
...
    "parameters" : {
        "param1" : {
            "name": "param1",
            "description": "The blah blah blah",
            "required": false,
            "type": "integer",
            "in": "formData"
        },
        "param2" : {
            "name": "param2",
            "description": "The blah blah blah.",
            "required": false,
            "type": "integer",
            "in": "formData"
        }
    }
}

Whereas what I would really like is the following:

"paths": {
  "/stuff": {
    "get": {
      "description": "Gets stuff",
      "operationId": "getStuff",
      "parameters": [
          "$ref": "#/parameters/myParameterSet",
           {
                "name": "ExtraParameterNotInSet",
                "description": "The blah blah blah",
                "required": false,
                "type": "integer",
                "in": "formData"
           }
      ]
    }
  }
}
...
    "parameters" : {
        "myParameterSet" : [
            "param1" : {
                "name": "param1",
                "description": "The blah blah blah",
                "required": false,
                "type": "integer",
                "in": "formData"
            },
            "param2" : {
                "name": "param2",
                "description": "The blah blah blah.",
                "required": false,
                "type": "integer",
                "in": "formData"
            }
        ]
    }
}

This appears to be desired by others as well.

@webron
Copy link
Contributor

webron commented Oct 12, 2015

Thanks for opening the ticket and making the suggestion. Proposal for spec changes should be made at the swagger-spec repository, and in fact there's already an existing ticket for this feature - https://github.com/swagger-api/swagger-spec/issues/445. Please voice your opinion there and help us evolve the spec.

@webron webron closed this as completed Oct 12, 2015
@programster
Copy link
Author

@webron sorry about that. I know now for in future. Thanks.

@webron
Copy link
Contributor

webron commented Oct 13, 2015

@programster - that's not a problem at all, just pointing you in the right direction. We value your opinion and it helps improve the spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants