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

fix: include route description as ts comment #82

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

epeters3
Copy link
Contributor

A small enhancement: for the schema.yaml flow, this PR makes a change to pass a route's description into the rendered ts code for the Endpoints type. Since you refer to one-schema routes by their route, its especially useful to have the route description propagate down into the Endpoints type, e.g. so you can see a route's description on hover:

endpoint-descriptions.mp4

@@ -171,6 +172,9 @@ export const Schema: OneSchema<Endpoints> = {
import type { OneSchema } from "@lifeomic/one-schema";

export type Endpoints = {
/**
* Fetches an array of all fruits.
*/
Copy link
Contributor Author

@epeters3 epeters3 Sep 21, 2023

Choose a reason for hiding this comment

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

This is the outcome ☝️: the route description is included on each route in Endpoints, when provided.

Copy link
Contributor

Choose a reason for hiding this comment

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

This type still gets generated for clients (even in the case of a non-YAML flow). Will be great to have client-side.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh excellent, good to hear.

@epeters3 epeters3 requested review from swain and david-wb September 21, 2023 21:34
Copy link
Contributor

@swain swain left a comment

Choose a reason for hiding this comment

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

Excellent idea

@epeters3 epeters3 merged commit 21f664f into master Sep 21, 2023
3 checks passed
@epeters3 epeters3 deleted the ep/endpoint-descriptions branch September 21, 2023 22:10
@github-actions
Copy link

🎉 This PR is included in version 5.3.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants