fxa / uritemplate-js

An javascript implementation of RFC6570 Uri Templates
MIT License
97 stars 20 forks source link

Illegal character = #18

Open Macil opened 8 years ago

Macil commented 8 years ago

I'm not very familiar with URI templates, so I might just be misunderstanding something. I'm trying to make sense of the URI template from https://cloud.google.com/pubsub/reference/rest/v1/projects.subscriptions/create, and thought passing it to a parser library would help me figure it out, but this library throws an exception on it:

var UriTemplate = require('uritemplate');
var template = UriTemplate.parse('https://pubsub.googleapis.com/v1/{name=projects/*/subscriptions/*}');

This exception gets thrown:

{"expressionText":"name=projects/*/subscriptions/*","message":"illegal character","character":"=","position":4}