Open kainpets opened 2 days ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
blueprint | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 1, 2024 0:06am |
Ideally ResourceType can be self consistent, so blueprint.resources[response.resourceType] is always NonNull
. Can we do this with a generic or inferred type form the openapi spec?
@razor-x Do you want ResourceType to be dynamically inferred from openapi schema at build time? I guess we could use https://www.npmjs.com/package/openapi-typescript for that or did you have something else in mind?
@kainpets what we need is a lot simpler than that. We already have typescript types for everything.
I think all we need for now is just type ResourceType = keyof openapi.components.schemas
The resource type properties should come from the schemas
I think we may need to introduce a generic
export const createBlueprint = ({ openapi }: T extends TypesModule): Blueprint<T> => {
Closes #10 Part of #1