Skip to content

Conversation

@lumik81
Copy link

@lumik81 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
Copy link

@vladbarosan vladbarosan left a 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 &&

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)

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


if (uri.Scheme == Uri.UriSchemeFile)
{
return File.ReadAllText(uri.AbsolutePath);

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

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.

2 participants