Updates to the Readme along with examples#144
Updates to the Readme along with examples#144darrelmiller merged 10 commits intomastermicrosoft/OpenAPI.NET:masterfrom
Conversation
README.md
Outdated
| The base JSON and YAML Readers are built into this project. Below is the list of supported "reader" projects. | ||
|
|
||
| - .NET Comment Reader: [Coming Soon] | ||
| - OData (CSDL) Reader: [Comming Soon] |
There was a problem hiding this comment.
Coming soon with one m.
README.md
Outdated
| The **OpenAPI.NET** SDK contains a useful object model for OpenAPI documents in .NET along with common serializers to extract raw OpenAPI JSON and YAML documents from the model. | ||
|
|
||
| **See more information on the Open API spec and its history here: <a href="https://www.openapis.org">Open API Initiative</a>** | ||
| **See more information on the OpenAPI spec and its history here: <a href="https://www.openapis.org">OpenAPI Initiative</a>** |
There was a problem hiding this comment.
The website for OAI itself has conflicting guideline on how to stylize its own name:
The Open API Initiative refers to the organization that oversees the specification. It must contain ONE space and FIVE capital letters. After the initial declaration, it may be referred to as the “OAI” in subsequent references, ...
Given that the new 3.0.1 spec seems to use OpenAPI (rather than Open API), I am guessing the OAI website itself just needs some updating?
There was a problem hiding this comment.
It is OpenAPI for everywhere except for Open API Initiative.
README.md
Outdated
|
|
||
| # Example Usage | ||
|
|
||
| Creating a OpenAPI Document |
README.md
Outdated
| var stream = await httpClient.GetStreamAsync("master/examples/v3.0/petstore.yaml"); | ||
|
|
||
| // Read V3 as YAML | ||
| var openApiDocument = new OpenApiStreamReader().Read(stream, out var diagnostics); |
There was a problem hiding this comment.
Suggest out var diagnostic (without the s) to be consistent with the type name.
README.md
Outdated
| var output = outputStringWriter.GetStringBuilder().ToString(); | ||
|
|
||
| Assert.Empty(diagnostics.Errors); | ||
| Assert.NotNull(openApiDocument); |
There was a problem hiding this comment.
I don't think these Asserts are needed in the example.
| outputStringWriter.Flush(); | ||
| var output = outputStringWriter.GetStringBuilder().ToString(); | ||
|
|
||
| Assert.Empty(diagnostics.Errors); |
There was a problem hiding this comment.
Can we use FluentAssertions here for consistency with the rest of the project?
|
|
||
| namespace Microsoft.OpenApi.Readers.Tests.V3Tests | ||
| { | ||
| public class OpenApiReadmeTests |
There was a problem hiding this comment.
Do we need this? I'm asking because the second test here means that our unit tests are making out-of-box calls to https://raw.githubusercontent.com/OAI/OpenAPI-Specification/
I am not sure if adding this dependency is a good idea.
There was a problem hiding this comment.
Yeah. I can pull it out of the tests. I just needed an example that I could confirm worked.
|
@PerthCharern I removed the readme tests until I can redo them based on an embedded resource and using the FluentAssertions. |
README.md
Outdated
|
|
||
| Creating a OpenAPI Document | ||
|
|
||
| ```Csharp |
|
Thanks @darrelmiller. Everything apart from some minor comments above looks okay to me. |
README.md
Outdated
| For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or | ||
| contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. | ||
|
|
||
| To provide feedback and ask questions you can use StackOverflow in the [OpenApi.net](https://stackoverflow.com/questions/tagged/openapi.net) tag or use the Slack OpenApi.net Slack channel which you can register for at http://slack.httpapis.com No newline at end of file |
There was a problem hiding this comment.
Maybe just "the OpenApi.net Slack channel" instead of "the Slack OpenApi.net Slack channel".
README.md
Outdated
| For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or | ||
| contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. | ||
|
|
||
| To provide feedback and ask questions you can use StackOverflow in the [OpenApi.net](https://stackoverflow.com/questions/tagged/openapi.net) tag or use the Slack OpenApi.net Slack channel which you can register for at http://slack.httpapis.com No newline at end of file |
There was a problem hiding this comment.
you can use StackOverflow with the OpenApi.net tag
That sounds a bit more natural to me, but feel free to ignore this if you don't agree.
No description provided.