-
Notifications
You must be signed in to change notification settings - Fork 261
Added support for runtime expressions embedded in string literals #290
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
Conversation
/// </summary> | ||
public class CompositeExpression : RuntimeExpression | ||
{ | ||
private readonly string template; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
template [](start = 32, length = 8)
not sure if template is the right word here... maybe "originalExpression" ?
{ | ||
private readonly string template; | ||
private Regex expressionPattern = new Regex("{(?<exp>[^}]+)"); | ||
/// <summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, please add one newline for readability
|
||
foreach (var item in matches.Cast<Match>()) | ||
{ | ||
var value = item.Groups["exp"].Captures.Cast<Capture>().First().Value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value [](start = 20, length = 5)
nit, call this runtimeExpression instead of value
Can we add one test using composite expression in https://github.com/Microsoft/OpenAPI.NET/blob/master/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiCallbackTests.cs ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PerthCharern I will make these changes. How do feel about releasing 1.1, rather than me back porting these changes to 1.0? |
Sounds fine to me.
|
Addresses issue #287