awslabs / aws-api-gateway-developer-portal

A Serverless Developer Portal for easily publishing and cataloging APIs
Apache License 2.0
928 stars 402 forks source link

ApiManagement problems with uploading .yml or json files including the word yaml #430

Open DavidJSykes opened 4 years ago

DavidJSykes commented 4 years ago

https://github.com/awslabs/aws-api-gateway-developer-portal/blob/e518f7720726c3aa26b5fb2817cd37b926f22182/dev-portal/src/pages/Admin/ApiManagement.jsx#L100-L106

Uploading a file ending in .yml does not work; it results in a JSONdecode error when it hits the else block.

The existing code needs to be updated to check for yml, and I would write it to use endsWith instead of includes to avoid having files named yaml.json being an issue.