-
Couldn't load subscription status.
- Fork 42
Url as a source #112
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
Url as a source #112
Conversation
lumik81
commented
Apr 11, 2018
- Extended solution to be able to handle Url as a source
- Fixed: the SwaggerParameter may be null
* Fixed: the SwaggerParameter may be null
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.
Looks good in principle with a couple of comments. if you can address them please we are good to go.
|
|
||
| private bool ValidateUri(Uri uri) | ||
| { | ||
| if (Instance.OldSpec.Scheme == Uri.UriSchemeFile && |
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.
why arent you comparing the parameter and instead the Instance.OldSpec
| return true; | ||
| } | ||
|
|
||
| if (Instance.OldSpec.Scheme == Uri.UriSchemeHttp || Instance.OldSpec.Scheme == Uri.UriSchemeHttps) |
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.
same here
|
|
||
| if (Instance.OldSpec.Scheme == Uri.UriSchemeHttp || Instance.OldSpec.Scheme == Uri.UriSchemeHttps) | ||
| { | ||
| // todo: validate the uri |
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.
wouldn't a call to this do a basic validation ? https://msdn.microsoft.com/en-us/library/system.uri.iswellformeduristring(v=vs.110).aspx
|
|
||
| if (uri.Scheme == Uri.UriSchemeFile) | ||
| { | ||
| return File.ReadAllText(uri.AbsolutePath); |
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.
can you please provide a Gist where this has been run successfully so we make sure there is no regression