OpenAPI-Qraft / openapi-qraft

Generate a type-safe TanStack Query React ✨ client from your OpenAPI document
https://openapi-qraft.github.io/openapi-qraft/
MIT License
31 stars 3 forks source link

Standalone, exported types #99

Closed EcksDy closed 1 month ago

EcksDy commented 3 months ago

Great work on the tool!

I'm exploring it as a replacement for openapi-generator, and noticed that I can't access the dto types that were generated from my routes directly.

Currently I use a workaround:

type CreateDto = components['schemas']['CreateSomethingDto'];

The use case I have, is using these types to annotate forms for example.

Am I missing a config, or is it not possible at the moment?

radist2s commented 3 months ago

Thank you for your interest.

Under the hood, Qraft uses the openapi-typescript utility for generating types from OpenAPI specifications. This utility generates similar types, and consequently, Qraft is compatible with them.

If openapi-typescript adds support for generating exportable component types, Qraft will also support this feature.

radist2s commented 1 month ago

@EcksDy, I've just released @openapi-qraft/cli@1.14.0-beta.5. My respects for your contribution! I will release a stable release any day now.