apiaryio / api-blueprint

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

Issue with underscore in both name and value of enumerated parameter #367

Closed bappelt closed 7 years ago

bappelt commented 7 years ago

Using the below spec, I get the error:

parameter 'start_time: recorded_at' is not found within the URI template '/api/devices/{imei}{?start_time}' for 'Device'

I have found that it works properly with an underscore in either the parameter name or the example value. It only seems to fail when there is an underscore in both places.

FORMAT: 1A

# API

## Device [/api/devices/{imei}{?start_time}]
A device resource

+ Parameters

    + start_time: recorded_at (enum[string], optional)

        QWERTY

        + Members
            + `recorded_at`
            + `created_at`
w-vi commented 7 years ago

_ is reserved character because it has a meaning in markdown so if you wan to use it in parameter name you need escape it using backticks. See the API Blueprint below it does not produce any warning or error.

Relevant part of the MSON Spec for more details: https://apiblueprint.org/documentation/mson/specification.html#6-reserved-characters--keywords

FORMAT: 1A

# API

## Device [/api/devices/{imei}{?start_time}]
A device resource

+ Parameters

    + `start_time`: `recorded_at` (enum[string], optional)

        QWERTY

        + Members
            + `recorded_at`
            + `created_at`
bappelt commented 7 years ago

Thanks @w-vi, that works for me.