GoogleCloudPlatform / go-endpoints

Cloud Endpoints for Go
https://go-endpoints.appspot.com
Apache License 2.0
255 stars 56 forks source link

Cannot use path parameter with '_' #104

Open ghost opened 9 years ago

ghost commented 9 years ago

I can't use get with list, because path parameters like product_id is converted to productID, and json fails to unmarshal it.

Config:

products.get
GET: "products/{product_id}"
products.list
GET: "products"

API call result (relative url):

GET: products/5629499534213120
Body: {"productID": "5629499534213120"}
Method: GetProduct
GET: products/chabs?product_id=5629499534213120
Body: {"product_id": "5629499534213120", "productID": "chabs"} 
Method: GetProduct
GET: products/?product_id=5629499534213120
Body: {"product_id": "5629499534213120"}
Method: ListProducts