Skip to content

Exporting a vtex library with OpenAPI Typescript interfaces #1516

@astrodomas

Description

@astrodomas

Describe the solution you'd like
I'd like to request a feature that would export all of vtex'es openapi interfaces as typescript interfaces.
For example @types/vtex-openapi.

Problem statement:
As consumers we are scaffolding your openapi interfaces manually. However, this is tedious + it introduces a problem for version management throughout multiple microservices. I believe it would be an easy process to generate and export the types by leveraging an existing tool called openapi-typescript. This would greatly improve developer experience by being able to use the latest openapi interfaces.

Example CLI command generates an openapi typescript interface:
npx openapi-typescript https://developers.vtex.com/api/openapi/catalog-api --output ./src/types/vtex/openapi/vtex-api-catalog.types.ts

Which then could be used in the code:

Image Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions