apiaryio / api-blueprint

API Blueprint
https://apiblueprint.org
MIT License
8.64k stars 2.14k forks source link

Accept any value in POST JSON #355

Closed maciejburda closed 7 years ago

maciejburda commented 7 years ago

Is there any way to make POST request of API Blueprint to accept any value?

Right now I have:

### Google [POST]
Login with Google

+ token (string) - google token

+ Request (application/json)
      {
          "token": "google"
      }

+ Response 200 (application/json)
      {
        "token": "xyz",
      }

And nothing apart from exactly the same body as as described is being consumed by Drakov.

for instance token = "google" -> works token = "realGoogleToken" -> doesn't work

I've found that's possible for GET requests, but no idea how to make it work for POST and headers.

maciejburda commented 7 years ago
### Google [POST]
Login with Google

+ token (string, required) - google token

+ Request (application/json)

    + Attributes

        + token: "google" (string, required)

+ Response 200 (application/json)
      {
        "token": "xyz",
      }

solves the issue, kind of. Though it will accept anything right now.

Thank you Wołek

pksunkara commented 7 years ago

@maciejburda We are working on the idea of adding authentication as discussed here. https://github.com/apiaryio/api-blueprint/issues/11