Skip to content

Read fragments of OpenAPI Specifications - #258

Merged
Darrel (darrelmiller) merged 14 commits into
vnextfrom
dm/read-fragment
May 20, 2018
Merged

Darrel (darrelmiller) merged 14 commits into
vnextfrom
dm/read-fragment

Conversation

@darrelmiller

Copy link
Copy Markdown
Member

See issue #256

}

/// <summary>
/// Reads the stream input and parses the fragment of an OpenAPI descinto an Open API Element.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

descinto [](start = 73, length = 8)

Typo. - I'm actually not sure which word this is supposed to be a typo of :)

{
diagnostic.Errors.Add(new OpenApiError(ex));
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we also validate the fragment after parsing?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

PerthCharern I'm not sure. I didn't think we could because of references, but as they are unresolved that shouldn't be a problem. Now I'm not sure. Will think about it some more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added it. Seems to be fine.

break;

case OpenApiSpecVersion.OpenApi3_0:
this.VersionService = new OpenApiV3VersionService();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this. [](start = 20, length = 5)

nit, remove these "this." for consistency.

/// </summary>
/// <param name="yamlDocument"></param>
/// <param name="version">OpenAPI version of the fragment</param>
/// <param name="diagnostic"></param>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit, either remove or populate

static ApisGuruTests()
{
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
_httpClient = new HttpClient(new HttpClientHandler()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Apparently HttpClient defaults to an earlier version of TLS that apis.guru no longer supports. This static option is just a way of telling HttpClient to use a new version of TLS.

@PerthCharern PerthCharern left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:shipit:

@darrelmiller
Darrel (darrelmiller) changed the base branch from master to vnext May 17, 2018 20:27
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