parameters in path: missed comma between flow collection entries

2,351 views
Skip to first unread message

Bartek Glomski

unread,
Apr 20, 2017, 8:14:24 AM4/20/17
to Swagger
Hi there,

I tried to regenerate client code using Swagger Online Editor and I'm getting an error. Editor was working fine for my solution couple of weeks ago when I last used it, but as I understand Editor was updated lately.
I narrowed down the problem to parameters in path, are they not supported anymore? when I remove {UserID} from the path and change parameter type to query it validates again.

Please take a look on my schema below. It was generated by Swashbuckle. I left only one method to make it more clear.

Any ideas? Thanks!

Error:

Errors

Parser error on line 12

missed comma between flow collection entries

schema:

{
  • swagger"2.0",
  • info: {
  • version: "v1",
  • title: "xxxx",
  • },
  • host"xxxx.dev.local",
  • schemes
    [
    • "http"
    ],
  • paths
    {
    • /Contact/{UserID}/Status
      {
      • get
        {
        • tags
          [
          • "UserStatus"
          ],
        • operationId"UserStatus_Get",
        • consumes: [ ],
        • produces
          [
          • "application/json",
          • "text/json"
          ],
        • parameters
          [
          • {
            • name"UserID",
            • in"path",
            • requiredtrue,
            • type"string"
            }
          ],
        • responses
          {
          • 200
            {
            • description"OK",
            • schema
              {
              • $ref"#/definitions/OutputUserStatus"
              }
            }
          }
        }
      }
    },
  • definitions
    {
    • OutputUserStatus
      {
      • required
        [
        • "Success"
        ],
      • type"object",
      • properties
        {
        • LapsedDate
          {
          • format"date-time",
          • type"string"
          },
        • RenewalDate
          {
          • format"date-time",
          • type"string"
          },
        • MembershipStatus
          {
          • enum
            [
            • "Active",
            • "Pending",
            • "Lapsed",
            • "QuoteOnly",
            • "QuoteLapsed",
            • "Inactive"
            ],
          • type"string"
          },
        • ContactId
          {
          • format"uuid",
          • type"string"
          },
        • Success
          {
          • type"boolean"
          },
        • ErrorCode
          {
          • type"string"
          },
        • ErrorMessage
          {
          • type"string"
          }
        }
      }
    }
}

Bartek Glomski

unread,
Apr 20, 2017, 8:41:14 AM4/20/17
to Swagger
ok, enclosing path with quotation marks "" seems to be solving the problem, but.. I can't test because Generate Client option is gone :)
Editor v2 link is not working too. Anybody knows if I can find editor v2 on swagger.io somehere?

thanks

Ron Ratovsky

unread,
Apr 20, 2017, 9:39:01 AM4/20/17
to swagger-sw...@googlegroups.com

The v2 link is back working.

 

Something’s off with your spec, not sure how you got that. You have a Javascript object there, and not a JSON.

Doesn’t even seem to be a valid Javascript object because the path is not escaped.

 

You’d need to have either a JSON or YAML to use the editor.

thanks

 

·         schemes

[

o    "http"

],

·         paths

{

o    /Contact/{UserID}/Status

{

§  get

{

§  tags

[

§  "UserStatus"

],

§  operationId"UserStatus_Get",

§  consumes: [ ],

§  produces

[

§  "application/json",

§  "text/json"

],

§  parameters

[

§   

§  {

§  name"UserID",

§  in"path",

§  requiredtrue,

§  type"string"

}

],

§  responses

{

§  200

{

§  description"OK",

§  schema

{

§  $ref"#/definitions/OutputUserStatus"

}

}

}

}

}

},

·         definitions

{

o    OutputUserStatus

}

}

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages