Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I specify multiple request types per endpoint in API Blueprint?

Tags:

apiblueprint

Is it possible to define what happens when PUT to /asdf with an empty request body happens vs PUT to /asdf with this request body with { "value": "somthing" }.

like image 880
Jinyoung Kim Avatar asked Nov 28 '25 06:11

Jinyoung Kim


1 Answers

Assuming the media type of both requests is the same and the response HTTP status codes differs this should be legit:

# PUT /asdf
+ Request Empty (application/json)
    + Headers

            Content-Lenght: 0

+ Response 400

+ Request With Value (application/json)

        { "value": "somthing" }

+ Response 204
like image 83
Zdenek Avatar answered Nov 29 '25 22:11

Zdenek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!