Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Character '@' is missing #6

Closed
hongbin opened this Issue · 3 comments

2 participants

@hongbin

Hi.
I have a case that the basePath of API cannot be determined until run-time, so I did the following.
##~ @api.basePath = "<%= @base_path %>"

Then I ran the tool and hoped the result is:
"basePath":"<%= @base_path %>"

However, the actual result is:
"basePath":"<%= base_path %>"

Is that anyway I can walk around? Thanks.

@solso
Owner

Quite a use case you have :-) The problem is that instance variables are "removed" doing a @ substitution, which also affect the @ on your string "<%= @base_path %>". Source2swagger is used SAFE=4 to avoid "accidents" and in this safely level instance variables cannot be written.

Will check if there is a way around it.

@solso
Owner

The commit 91cf0de should fix the issue. See the example test/data/sample6.rb

@hongbin

Cool. Thanks for the fix.

@solso solso closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.