Skip to content
This repository was archived by the owner on Sep 6, 2024. It is now read-only.
This repository was archived by the owner on Sep 6, 2024. It is now read-only.

Use the official OpenAPI specification to generate types #57

Open
@jamieknight-db

Description

@jamieknight-db

Discussed in #54

Originally posted by ognis1205 July 26, 2024
The URL paths, requests, and responses of the backend server to be used are strictly defined by the OpenAPI specification.

I think it is better to automatically generate TypeScript interfaces from OpenAPI and then define the paths as union types and the requests and responses as interfaces synchronized with the OpenAPI specification using utility types.

Additionally, rather than using fetch, if you use third-party libraries like axios and implement some utilities, you can implement everything in a type-safe manner with interfaces synchronized with OpenAPI in a single API.

Metadata

Metadata

Assignees

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