apiaryio / fury-adapter-swagger

Swagger 2.0 parser adapter for Fury.js
MIT License
11 stars 12 forks source link

Escape generated URI Template variables #109

Closed kylef closed 7 years ago

kylef commented 7 years ago

URI Template variables may only contain ALPHA / DIGIT / "_" / pct-encoded as per the URI Template specification (RFC 6570 section 2.3):

2.3. Variables

 variable-list =  varspec *( "," varspec )
 varspec       =  varname [ modifier-level4 ]
 varname       =  varchar *( ["."] varchar )
 varchar       =  ALPHA / DIGIT / "_" / pct-encoded

As such, when we generated URI Template variable names they should be correctly escaped as pointed out in https://github.com/apiaryio/dredd/issues/799. This pull request adds this escaping.

pksunkara commented 7 years ago

Looks good but tests failing.

kylef commented 7 years ago

@pksunkara I've fixed the code linting failure.