apiaryio / api-blueprint

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

pass dynamic parameters are not working #428

Closed diegoug closed 5 years ago

diegoug commented 6 years ago
FORMAT: 1A
HOST: http://polls.apiblueprint.org/

# test

Polls is a simple API allowing consumers to view polls and vote in them.

## The translation API [/i18n/{id}]

+ Parameters

    + id (optional, number)

### Retrieves a translation [GET]

+ Request Volkswagen
    + Parameters

        + id: 1

+ Response 200 (application/json)

        { 
            "message": "Volkswagen" 
        }

+ Request Ford
    + Parameters

        + id: 2

+ Response 200 (application/json)

        { 
            "message": "ford" 
        }

I am trying to run this example and I pass the parameters in a dynamic way but it always responds the same to me, the first answer, I do not know what is happening, I tried everything but nothing works

https://private-cf6fe6-testing01.apiary-mock.com/i18n/1 https://private-cf6fe6-testing01.apiary-mock.com/i18n/2

response:

{ 
    "message": "Volkswagen" 
}

https://app.apiary.io/testing01

Ritural commented 5 years ago

Hey @diegoug,

I don't think that multiple responses based on dynamic parameters has been implemented yet.

Checkout these similar issues

I managed to get around it but it was by explicitly writing the url for my 2nd response.

So this could work for you

FORMAT: 1A
HOST: http://polls.apiblueprint.org/

# test

Polls is a simple API allowing consumers to view polls and vote in them.

## The translation API [/i18n/{id}]

+ Parameters

    + id (optional, number)

### Retrieves a translation [GET /i18n/{id}]

+ Request Volkswagen
    + Parameters

        + id: 1

+ Response 200 (application/json)

        { 
            "message": "Volkswagen" 
        }

### Retrieves a translation 2nd example [GET /i18n/2]

+ Request Ford
    + Parameters

        + id: 2

+ Response 200 (application/json)

        { 
            "message": "ford" 
        }
kylef commented 5 years ago

These are implement in the parser, please seek feature requests with any tooling that doesn't properly support it. We're tracking this in the issue at https://github.com/apiaryio/api-blueprint/issues/58#issuecomment-230025964.

anentropic commented 4 years ago

This is still not supported (rendered) in Apiary

I'm not sure where to report such an issue though