Forum Discussion
Hi mrbalky,
It looks like your API definition is using a `get` method to send a body parameter--that's not allowed in a GET, you will have to use `put`, `post`, or `delete`. I'm guessing you really want a `post` operation, which should work just fine like this:
paths:
'/api-public/v1/foo/{asdf}':
post:
tags:
- Foo
summary: "Do foo"
description: Foo foo foo foo
parameters:
- name: asdf
in: path
type: string
required: true
- $ref: '#/parameters/qwerty'
responses:
'200':
description: yeah
Please post back if you still have issues!
- mrbalky10 years agoNew Contributor
D'oh! Yep, you're right. POST is what I wanted.
Still have the problem, though. Here's without the $ref to '#/parameters/qwerty'
And here's with the $ref:
Thanks,
Charlie
- RonRatovsky10 years ago
Staff
Hi!
I believe there's indeed an issue with rendering referenced body parameter, regardless of the HTTP method and we'll need to look into resolving that. For now, the workaround would be to not reference such parameters and repeat them for each operation. We'll of course update you when a solution in the rendering is available.
- fehguy10 years ago
Staff
Ron is correct, it does look like there's a bug. I've got it tracked in the swagger-ui project and we'll get this updated in SwaggerHub in just a bit. I'll post back here when it is.