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

docs: Add http/openapi documentation & ci workflow #2678

Merged

Conversation

shahzadlone
Copy link
Member

@shahzadlone shahzadlone commented Jun 4, 2024

Relevant issue(s)

Related #510
Resolve #2677

Description

  • Detect OpenAPI / HTTP documentation is always up to date.
  • Generate open-api docs in the appropriate dir.

How has this been tested?

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

  • WSL2 instance

@shahzadlone shahzadlone added the documentation Improvements or additions to documentation label Jun 4, 2024
@shahzadlone shahzadlone added this to the DefraDB v0.12 milestone Jun 4, 2024
@shahzadlone shahzadlone requested a review from nasdf June 4, 2024 01:18
@shahzadlone shahzadlone self-assigned this Jun 4, 2024
@shahzadlone shahzadlone changed the title PR: Remove extra step from cli docs action docs: Add http/openapi documentation & ci workflow Jun 4, 2024
Copy link

codecov bot commented Jun 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.15%. Comparing base (1eb1fb5) to head (2cc8e99).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2678      +/-   ##
===========================================
+ Coverage    78.12%   78.15%   +0.03%     
===========================================
  Files          303      303              
  Lines        23052    23052              
===========================================
+ Hits         18009    18016       +7     
+ Misses        3681     3675       -6     
+ Partials      1362     1361       -1     
Flag Coverage Δ
all-tests 78.15% <ø> (+0.03%) ⬆️

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

see 6 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 1eb1fb5...2cc8e99. Read the comment docs.

@shahzadlone shahzadlone marked this pull request as ready for review June 4, 2024 01:35
@shahzadlone shahzadlone requested a review from a team June 4, 2024 01:36
@shahzadlone shahzadlone changed the title docs: Add http/openapi documentation & ci workflow docs(i): Add http/openapi documentation & ci workflow Jun 4, 2024
@shahzadlone shahzadlone changed the title docs(i): Add http/openapi documentation & ci workflow docs: Add http/openapi documentation & ci workflow Jun 4, 2024

.PHONY: docs\:cli
docs\:cli:
rm -f docs/website/references/cli/*.md
go run cmd/genclidocs/main.go -o docs/website/references/cli

.PHONY: docs\:http
docs\:http:
go run cmd/genopenapi/main.go | python -m json.tool > docs/website/references/http/openapi.json
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: Why do we want to have the openAPI json output published in our docs? I'm asking because it's not really something to be read by humans.

Copy link
Member

Choose a reason for hiding this comment

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

we can have it render a UI like this with some config options https://docs.source.network/sourcehub/api

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see. Hopefully we can make the table easier to read because the one at the link is pretty terrible 😅

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is one of my favourite API docs: https://docs.stripe.com/api
If we can eventually make it look like this but on top of it be able to execute the request to a configurable endpoint, that would be amazing.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is one of my favourite API docs: docs.stripe.com/api If we can eventually make it look like this but on top of it be able to execute the request to a configurable endpoint, that would be amazing.

Nice the stripe docs look really nice. Whoever is responsible for website doc stuff can easily plug it in using the json file this PR introduces

@shahzadlone shahzadlone requested review from a team and fredcarle June 4, 2024 18:59
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

@shahzadlone shahzadlone merged commit 7dc07e7 into sourcenetwork:develop Jun 4, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Streamline OpenAPI / HTTP documentation
3 participants