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

feat: Generate OpenAPI command #2235

Merged
merged 5 commits into from
Jan 23, 2024

Conversation

nasdf
Copy link
Member

@nasdf nasdf commented Jan 19, 2024

Relevant issue(s)

Resolves #2234

Description

This PR adds a command to output the current OpenAPI specification

Tasks

  • I made sure the code is well commented, particularly hard-to-understand areas.
  • I made sure the repository-held documentation is changed accordingly.
  • I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in tools/configs/chglog/config.yml).
  • I made sure to discuss its limitations such as threats to validity, vulnerability to mistake and misuse, robustness to invalidation of assumptions, resource requirements, ...

How has this been tested?

go run ./cmd/genopenapi

Specify the platform(s) on which this was tested:

  • MacOS

@nasdf nasdf added the area/api Related to the external API component label Jan 19, 2024
@nasdf nasdf self-assigned this Jan 19, 2024
@nasdf nasdf requested a review from a team January 19, 2024 20:36
Copy link

codecov bot commented Jan 19, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (97fc57e) 74.02% compared to head (915d65b) 74.16%.

❗ Current head 915d65b differs from pull request most recent head 7c68357. Consider uploading reports for the commit 7c68357 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2235      +/-   ##
===========================================
+ Coverage    74.02%   74.16%   +0.14%     
===========================================
  Files          256      256              
  Lines        25732    25634      -98     
===========================================
- Hits         19048    19011      -37     
+ Misses        5365     5319      -46     
+ Partials      1319     1304      -15     
Flag Coverage Δ
all-tests 74.16% <81.25%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
http/handler.go 77.94% <81.25%> (-2.39%) ⬇️

... and 23 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 97fc57e...7c68357. Read the comment docs.

Copy link
Collaborator

@fredcarle fredcarle left a comment

Choose a reason for hiding this comment

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

LGTM

@nasdf nasdf merged commit 958e471 into sourcenetwork:develop Jan 23, 2024
26 of 27 checks passed
shahzadlone pushed a commit that referenced this pull request Jan 23, 2024
## Relevant issue(s)

Resolves #2234

## Description

This PR adds a command to output the current OpenAPI specification

## Tasks

- [x] I made sure the code is well commented, particularly
hard-to-understand areas.
- [x] I made sure the repository-held documentation is changed
accordingly.
- [x] I made sure the pull request title adheres to the conventional
commit style (the subset used in the project can be found in
[tools/configs/chglog/config.yml](tools/configs/chglog/config.yml)).
- [x] I made sure to discuss its limitations such as threats to
validity, vulnerability to mistake and misuse, robustness to
invalidation of assumptions, resource requirements, ...

## How has this been tested?

`go run ./cmd/genopenapi`

Specify the platform(s) on which this was tested:
- MacOS
nasdf added a commit to nasdf/defradb that referenced this pull request Jan 23, 2024
## Relevant issue(s)

Resolves sourcenetwork#2234

## Description

This PR adds a command to output the current OpenAPI specification

## Tasks

- [x] I made sure the code is well commented, particularly
hard-to-understand areas.
- [x] I made sure the repository-held documentation is changed
accordingly.
- [x] I made sure the pull request title adheres to the conventional
commit style (the subset used in the project can be found in
[tools/configs/chglog/config.yml](tools/configs/chglog/config.yml)).
- [x] I made sure to discuss its limitations such as threats to
validity, vulnerability to mistake and misuse, robustness to
invalidation of assumptions, resource requirements, ...

## How has this been tested?

`go run ./cmd/genopenapi`

Specify the platform(s) on which this was tested:
- MacOS
nasdf added a commit to nasdf/defradb that referenced this pull request Jan 23, 2024
## Relevant issue(s)

Resolves sourcenetwork#2234

## Description

This PR adds a command to output the current OpenAPI specification

## Tasks

- [x] I made sure the code is well commented, particularly
hard-to-understand areas.
- [x] I made sure the repository-held documentation is changed
accordingly.
- [x] I made sure the pull request title adheres to the conventional
commit style (the subset used in the project can be found in
[tools/configs/chglog/config.yml](tools/configs/chglog/config.yml)).
- [x] I made sure to discuss its limitations such as threats to
validity, vulnerability to mistake and misuse, robustness to
invalidation of assumptions, resource requirements, ...

## How has this been tested?

`go run ./cmd/genopenapi`

Specify the platform(s) on which this was tested:
- MacOS
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
## Relevant issue(s)

Resolves sourcenetwork#2234

## Description

This PR adds a command to output the current OpenAPI specification

## Tasks

- [x] I made sure the code is well commented, particularly
hard-to-understand areas.
- [x] I made sure the repository-held documentation is changed
accordingly.
- [x] I made sure the pull request title adheres to the conventional
commit style (the subset used in the project can be found in
[tools/configs/chglog/config.yml](tools/configs/chglog/config.yml)).
- [x] I made sure to discuss its limitations such as threats to
validity, vulnerability to mistake and misuse, robustness to
invalidation of assumptions, resource requirements, ...

## How has this been tested?

`go run ./cmd/genopenapi`

Specify the platform(s) on which this was tested:
- MacOS
@fredcarle fredcarle added this to the DefraDB v0.10 milestone Mar 4, 2024
@islamaliev
Copy link
Contributor

Bug bash result:
sent get request on http://localhost:9181/openapi.json and received the expected json.
ran go run ./cmd/genopenapi and got the expected json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Related to the external API component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add command to generate OpenAPI specification
3 participants