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

Generating import file for postman #770

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Tokesh
Copy link
Collaborator

@Tokesh Tokesh commented Jan 7, 2025

Description

Generating file which importable for Postman

Issues Resolved

[#659]

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Tokesh <tokesh789@gmail.com>
Copy link
Contributor

github-actions bot commented Jan 7, 2025

Changes Analysis

Commit SHA: f17ed0a
Comparing To SHA: 7ff1821

API Changes

Summary

NO CHANGES

Report

The full API changes report is available at: https://github.com/opensearch-project/opensearch-api-specification/actions/runs/12658031691/artifacts/2397681920

API Coverage

Before After Δ
Covered (%) 616 (60.33 %) 616 (60.33 %) 0 (0 %)
Uncovered (%) 405 (39.67 %) 405 (39.67 %) 0 (0 %)
Unknown 43 43 0

Tokesh added 2 commits January 7, 2025 20:00
Signed-off-by: Tokesh <tokesh789@gmail.com>
Signed-off-by: Tokesh <tokesh789@gmail.com>
@Tokesh
Copy link
Collaborator Author

Tokesh commented Jan 7, 2025

TODO:

  • Add only unique paths to postman
  • Create folders in postman
  • Add tests
  • Fix lint
  • Recheck generated file
  • Refactor code

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Spec Test Coverage Analysis

Total Tested
546 546 (100 %)

Signed-off-by: Tokesh <tokesh789@gmail.com>
@Tokesh Tokesh changed the title feat: generating import file for postman Generating import file for postman Jan 7, 2025
Tokesh added 2 commits January 7, 2025 20:31
Signed-off-by: Tokesh <tokesh789@gmail.com>
Signed-off-by: Tokesh <tokesh789@gmail.com>
Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

This is a good start.

You should separate responsibilities better and call things by their name. Let me explain. The ChapterReader's job is to read chapters but to execute tests, it's certainly not to collect collections for Postman.

Build a new tool like the merger or linter called maybe exporter. It should use the existing classes to read the spec tests, then export them into various formats, one of which would be Postman.

@@ -221,6 +221,13 @@ export class OpenSearchHttpClient {
}
}

get_url(): string | undefined {
if (this._opts != null && this._opts.url != null && this._opts.url !== '') {
Copy link
Member

Choose a reason for hiding this comment

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

I think lodash isEmpty can this this cleaner, maybe just _.isEmpty(this._opts?.url) ? DEFAULT_URL : this._opts?.url.

Tokesh added 2 commits January 7, 2025 22:34
Signed-off-by: Tokesh <tokesh789@gmail.com>
Signed-off-by: Tokesh <tokesh789@gmail.com>
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