Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hash syntax in swagger schemas #147

Merged
merged 1 commit into from
Sep 27, 2020
Merged

Fix hash syntax in swagger schemas #147

merged 1 commit into from
Sep 27, 2020

Conversation

johannesengl
Copy link
Contributor

**Issue #146

Summary

The following hash syntax being used in notification_schema.rb and subscription_schema.rb schemas causes a syntax error on ruby 2.1

$ruby -e "h = {\"key\": \"value\"}; puts h"
-e:1: syntax error, unexpected ':', expecting =>
h = {"key": "value"}; puts h
           ^
-e:1: syntax error, unexpected '}', expecting end-of-input
h = {"key": "value"}; puts h

Using the following syntax we get the hash as expected with a symbol as the key:

ruby -e "h = {key: \"value\"}; puts h"
{:key=>"value"}

Ruby 2.1 raises a syntax error when initializing hashes with keys using the following syntax: {'key': 'value'}
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 34634aa on johannesengl:fix-swagger-schema-hash-syntax into 10488e6 on simukappu:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 34634aa on johannesengl:fix-swagger-schema-hash-syntax into 10488e6 on simukappu:master.

@simukappu
Copy link
Owner

LGTM.
Thank you for your contribution!

@simukappu simukappu merged commit 4c02114 into simukappu:master Sep 27, 2020
simukappu pushed a commit that referenced this pull request Nov 25, 2020
Ruby 2.1 raises a syntax error when initializing hashes with keys using the following syntax: {'key': 'value'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants