Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Escaping parameter names and values fails #391

Closed
w-vi opened this issue Sep 14, 2016 · 8 comments
Closed

Escaping parameter names and values fails #391

w-vi opened this issue Sep 14, 2016 · 8 comments

Comments

@w-vi
Copy link
Contributor

w-vi commented Sep 14, 2016

Following APIB produces warning on the first parameter
warning: (3) unable to parse additional parameter traits, expected '([required | optional], [<type> | enum[<type>])', e.g. '(optional, string)'; line 8, column 7 - line 8, column 38

If the escaping takes place on the parameter name as well as example value it fails.

# A

## A [/a{?u_u,u}]

### Get A [GET]

+ Parameters 
    + `u_u` (required, string, `a_a`)
    + u (required, string, `a_a`)

+ Response 200

CURRENT WORKAROUND
Use different syntax for the example:

    + `u_u`: `a_a` (required, string)
@w-vi w-vi changed the title Escaping doesn't really work Escaping parameter names and values fails Sep 14, 2016
@pksunkara
Copy link
Contributor

Old parameter format doesn't support escaping for the parameter name. This is intentional.

@w-vi
Copy link
Contributor Author

w-vi commented Sep 16, 2016

Huh, what? Why? Is it documented somewhere? I haven't found it.

@pksunkara
Copy link
Contributor

Old parameter format is not an MSON format. Escaping as a concept only exists in MSON. Old parameter format is deprecated currently.

@w-vi
Copy link
Contributor Author

w-vi commented Sep 16, 2016

I see, so we should issue deprecation warning I suppose as this is confusing.

@pksunkara
Copy link
Contributor

We currently support both formats albeit one of them without being the spec. MSON parameters and headers RFC should take care of this later.

I am closing this for now.

@w-vi w-vi reopened this Sep 16, 2016
@w-vi
Copy link
Contributor Author

w-vi commented Sep 16, 2016

This is not solved really, as it is nowhere to be seen that I am using deprecated feature.

@pksunkara
Copy link
Contributor

It is not deprecated yet. But there is no mention of the old format anywhere in the spec.

@w-vi
Copy link
Contributor Author

w-vi commented Sep 16, 2016

So lets clarify it somehow (spec, docs, warning) and then we can close it.

kylef added a commit to apiaryio/snowcrash that referenced this issue Oct 12, 2016
A parameter list item such as ``+ `u_u` (required, string, `a_a`)`` was
being treated as an MSON aligned parameter when it wasn't.

Fixes apiaryio/drafter#391
@kylef kylef mentioned this issue Oct 13, 2016
kylef pushed a commit that referenced this issue Jul 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants