Same endpoint for POST and GET method without the duplicate key error? #2699
-
Hello everyone, I am kinda confused as to why this isn't a thing, or I am I doing this wrong entirely? I have a user profile path (Using swagger) |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
It should be supported, I just find your example a bit unclear, is the path |
Beta Was this translation helpful? Give feedback.
-
You've written your definition incorrectly. Both http methods go under the same path entry. openapi: 3.1.0
info:
title: Test API
version: 1.2.3
paths:
/user/profile/{iid}:
get:
...
post:
... |
Beta Was this translation helpful? Give feedback.
-
Is there a way to do this with refs? I haven't been able to figure it out. Something like this (this doesnt work, but is there something similar?
|
Beta Was this translation helpful? Give feedback.
-
This seems to have been resolved, closing. |
Beta Was this translation helpful? Give feedback.
A path item can contain only one $ref. You'll have to put the GET and POST definitions into the same file so they can be $ref'erenced together: