Skip to content

docs: generate clients from openapi#778

Merged
michael-0acf4 merged 5 commits intomainfrom
met-576-docs-add-openapi-to-the-rest-documentation
Jul 5, 2024
Merged

docs: generate clients from openapi#778
michael-0acf4 merged 5 commits intomainfrom
met-576-docs-add-openapi-to-the-rest-documentation

Conversation

@michael-0acf4
Copy link
Copy Markdown
Contributor

@michael-0acf4 michael-0acf4 commented Jul 4, 2024

Demonstrate how to use the openapi spec to generate clients in most languages/frameworks.

Migration notes

None

  • The change comes with new or modified tests
  • Hard-to-understand functions have explanatory comments
  • End-user documentation is updated to reflect the change

Summary by CodeRabbit

  • Documentation
    • Updated REST API documentation URLs with placeholders for easier configuration.
    • Added information on generating and using OpenAPI clients, including TypeScript fetch client generation.
  • Bug Fixes
    • Corrected a regular expression in import handling to ensure accurate replacements.
  • Chores
    • Improved file writing by appending a newline character to JSON strings.

@linear
Copy link
Copy Markdown

linear Bot commented Jul 4, 2024

@michael-0acf4
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 4, 2024

Walkthrough

Recent changes were made across several files. Specifically, a regular expression was corrected in the fix-declarations.ts file, ensuring proper import statement handling. In jsr-gen.ts, a newline character was added when writing JSON strings. Additionally, the documentation in rest/index.mdx was updated to include URL placeholders and instructions for generating OpenAPI clients.

Changes

File Path Summary
typegraph/.../fix-declarations.ts Corrected a regular expression in string replacement for .d.ts file imports.
typegraph/.../jsr-gen.ts Appended a newline character after writing a JSON string to a file using Deno.writeTextFileSync.
website/docs/.../index.mdx Updated URLs to use placeholders {TYPEGATE_URL} and {TG_NAME} and added details about generating OpenAPI clients.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Comment thread website/docs/reference/rest/index.mdx
Natoandro
Natoandro previously approved these changes Jul 4, 2024
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.94%. Comparing base (1e3748b) to head (9e5676e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #778   +/-   ##
=======================================
  Coverage   69.94%   69.94%           
=======================================
  Files         139      139           
  Lines       16175    16175           
  Branches     1474     1474           
=======================================
  Hits        11313    11313           
  Misses       4837     4837           
  Partials       25       25           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@michael-0acf4 michael-0acf4 merged commit 02d63c3 into main Jul 5, 2024
@michael-0acf4 michael-0acf4 deleted the met-576-docs-add-openapi-to-the-rest-documentation branch July 5, 2024 15:41
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.

3 participants