Skip to content

[v2] OpenAPI To Contract #1638

Description

@KingSora

Describe the feature

The way I'm using ORPC is to derive some of my contract (mainly input & output) from my database schema (via drizzle-orm). The problem here is that the contract has now drizzle-orm as its dependency which is not very ideal to have in the client build. Other solutions like TRPC don't have this limitations because the whole system is based on types which are non-existent at runtime, but this doesn't apply for the contract.

In v1 there was a possibility (although it was marked as "unstable") to create a contract from an OpenAPI spec file. This was achieved via hey-api and the corresponding orpc plugin. I already spotted a PR which should support orpc v2 (hey-api/hey-api#4195). Now my question is whether this method of creating a contract from a OpenAPI file is the main method going forward or whether orpc will give you a build-in way of doing that going forward? As of right now the docs for v2 (yes I know they are still work in progress) are not emntioning anything about this topic. I'm very certain that my case is not "exotic" and many users could and will face the same contract dependency problem.

Additional information

  • Would you be willing to help implement this feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions