8000 Tagging a parameter with "pattern" doesn't seem to always have affect · Issue #369 · go-swagger/go-swagger · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Tagging a parameter with "pattern" doesn't seem to always have affect #369
Closed
@sflxn

Description

@sflxn

We want to check the regex of a request parameter, but "pattern" doesn't seem to have any affect.

Example:

    "parameters": [{
      "name": "name",
      "in": "query",
      "description": "Assign the specified name to the container. Must match /?[a-zA-Z0-9_-]+.",
      "type": "string",
      "pattern": "/?[a-zA-Z0-9_-]+"
    }, {

query:

  1. curl -i -X POST http://127.0.0.1:49000/v1.22/containers/create?name=@#!
  2. curl -i -X POST http://127.0.0.1:49000/v1.22/containers/create?name=%^@
  3. curl -i -X POST http://127.0.0.1:49000/v1.22/containers/create?name=abc123

results:

  1. {"code":422,"message":"name in query should match '/?[a-zA-Z0-9_-]+'"}
  2. HTTP/1.1 501 Not Implemented
    Content-Type: application/json
    Date: Fri, 04 Mar 2016 22:26:35 GMT
    Content-Length: 53

"operation container.Create has not yet implemented"

  1. HTTP/1.1 501 Not Implemented
    Content-Type: application/json
    Date: Fri, 04 Mar 2016 22:26:35 GMT
    Content-Length: 53

"operation container.Create has not yet implemented"

Comments:

query 1 and 3 are correct but query 2 is not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0