-
Notifications
You must be signed in to change notification settings - Fork 279
Updates to the Readme along with examples #144
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
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.
I don't see it.
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.
Coming soon with one m.
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.
Now I see it
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is OpenAPI for everywhere except for Open API Initiative.
README.md
Outdated
|
|
||
| # Example Usage | ||
|
|
||
| Creating a OpenAPI Document |
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.
an
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use FluentAssertions here for consistency with the rest of the project?
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.
Sure.
|
|
||
| namespace Microsoft.OpenApi.Readers.Tests.V3Tests | ||
| { | ||
| public class OpenApiReadmeTests |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I can pull it out of the tests. I just needed an example that I could confirm worked.
PerthCharern
left a comment
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 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 |
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.
" ```C# "
|
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 [[email protected]](mailto:[email protected]) 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 |
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.
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 [[email protected]](mailto:[email protected]) 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 |
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.
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.