-
Notifications
You must be signed in to change notification settings - Fork 70
feature: update schemas $id structure: model, component, connection and all which they reference #308
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
base: master
Are you sure you want to change the base?
feature: update schemas $id structure: model, component, connection and all which they reference #308
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -8,7 +8,7 @@ | |||||||
/** | ||||||||
* Meshery manages entities in accordance with their specific capabilities. This field explicitly identifies those capabilities largely by what actions a given component supports; e.g. metric-scrape, sub-interface, and so on. This field is extensible. Entities may define a broad array of capabilities, which are in-turn dynamically interpretted by Meshery for full lifecycle management. | ||||||||
*/ | ||||||||
export interface HttpsSchemasMesheryIoCapabilityJson { | ||||||||
export interface HttpsSchemasMesheryIoV1Alpha1CapabilityCapabilityJson { | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To Gemini's point, is this interface name auto-generated (something out of our direct control) or something that we might easily shorten, e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the interface name is auto-generated from the JSON schema file name. Shortening it to
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, wow, it can even respond to the messages 😮 Right all typescript in this pr is auto generated. To the point that it would be nice to have this autogeneration in ci, so that pr will not have this load. make generate-types on their pr There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, right, it is related. The name is generated from $id and now $id is "https://schemas.meshery.io/v1alpha1/capability/capability.json" wondering if it means some updates will be required on frontend 🤔 ? |
||||||||
/** | ||||||||
* Specifies the version of the schema to which the capability definition conforms. | ||||||||
*/ | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider aliasing
HttpsSchemasMesheryIoCoreJson
to something shorter, as it's used repeatedly. The same applies to other interfaces in this file.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gemini-code-assist, will you suggest how to create an alias?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple of ways to create an alias in TypeScript. One common approach is to use a type alias. Here's how you could apply that to
HttpsSchemasMesheryIoCoreJson
:You would place this line at the top of the
core.d.ts
file. Then, you can useCoreJson
throughout the file as a shorthand forHttpsSchemasMesheryIoCoreJson
. This improves readability, especially when the type is used repeatedly.Another approach, if
HttpsSchemasMesheryIoCoreJson
is an interface, you could use interface extension:However, this approach is less about creating a simple alias and more about creating a new interface that inherits from the original. For the purpose of shortening the name, a type alias is generally more appropriate.