Skip to content
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

Adds ToApiManifest extension method for converting an OpenAPI document to an APIManifest #48

Merged
merged 9 commits into from
Nov 16, 2023

Conversation

peombwa
Copy link
Contributor

@peombwa peombwa commented Nov 13, 2023

This PR fixes #46 by making the following changes:

  • Adds an OpenApi to ApiManifest mapping doc that's implemented by the extension method.
  • Adds ToApiManifest extension method for OpenApiDocument. The method will be used dependent tools to convert and OpenAPI document to an ApiManifest.
  • Adds unit tests to validate the conversion.

Proposed Usage

// Convert an instance of OpenAPIDocument to an ApiManifest document.
var openApiDocument = new OpenApiStreamReader().Read(stream, out var diagnostic);
var apiManifest = openApiDocument.ToApiManifest("https://example.com/openApi.yaml", "MyApplicationName");
// or
var apiManifest = openApiDocument.ToApiManifest("https://example.com/openApi.yaml", "MyApplicationName", "GraphApi", "PubName", "[email protected]");

@peombwa peombwa marked this pull request as ready for review November 14, 2023 23:14
@peombwa peombwa self-assigned this Nov 14, 2023
src/lib/TypeExtensions/OpenApiDocumentExtensions.cs Outdated Show resolved Hide resolved
docs/OpenApiToApiManifestMapping.md Outdated Show resolved Hide resolved
@peombwa peombwa requested review from zengin and baywet November 15, 2023 23:45
zengin
zengin previously approved these changes Nov 16, 2023
Copy link

@zengin zengin left a comment

Choose a reason for hiding this comment

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

Thank you for applying suggested changes!

Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

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

thanks for making the updates, a couple of things left.

src/lib/TypeExtensions/OpenApiDocumentExtensions.cs Outdated Show resolved Hide resolved
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

94.5% 94.5% Coverage
0.0% 0.0% Duplication

@peombwa peombwa requested a review from baywet November 16, 2023 19:09
@peombwa peombwa enabled auto-merge November 16, 2023 20:05
@peombwa peombwa merged commit 4ed92fb into main Nov 16, 2023
7 checks passed
@peombwa peombwa deleted the po/AddsGenerationOfApiManifest branch November 16, 2023 20:17
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.

Add support for generation of ApiManifest from an OpenApi document instance
3 participants