SteMMo
7 years agoOccasional Visitor
Define a parameter for both path and body (in different paths)
Hi all,
I'm just starting with SwaggerHub.
In my definition I'd like to share the definition of a parameter that I need to use both in a path and body position.
I wrote something like but I've got always some kind of error:
/root/{deviceId}/config:
post:
tags:
- "Parameters"
parameters:
- $ref: "#/definitions/DeviceID"
DeviceID:
type: string
description: Generato a partire dal MAC address
example: AABBCCEE
Declared path parameter "deviceId" needs to be defined as a path parameter at either the path or operation level
If I add:
in: path
I get the error that sibling values are not allowed ..
I'd like to define a simple type that defines and documents the parameter used in path like:
/root/{deviceID}/config
and used in body ilke:
/root/ann
{
...
"deviceID": "AAABBB",
...
}
Thanks!