-
I'm able to successfully create a OpenAPI spec from my TypeSpec, as well as JSON Schema files. But how about something as simple as plain TypeScript interfaces? Is there a default emitter that can create these? I'm aware that I could do TypeSpec -> JSON Schema -> TypeScript, and I tried that already, but that seems a bit convoluted 🤨
would become // models.d.ts
export interface Pet {}
export interface Person {
pet: Pet;
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I believe this should be coming soon as part of our Rest client emitter work, though I can't say for sure. We definitely intend to have "model emitters" in all languages we support eventually. If it's interesting or useful, we have a test emitter that does this, which you could perhaps use. Just note that it's just for testing purposes and you will have to copy/paste the code. You can find it here: https://github.com/microsoft/typespec/blob/main/packages/compiler/test/emitter-framework/typescript-emitter.ts |
Beta Was this translation helpful? Give feedback.
I believe this should be coming soon as part of our Rest client emitter work, though I can't say for sure. We definitely intend to have "model emitters" in all languages we support eventually.
If it's interesting or useful, we have a test emitter that does this, which you could perhaps use. Just note that it's just for testing purposes and you will have to copy/paste the code. You can find it here: https://github.com/microsoft/typespec/blob/main/packages/compiler/test/emitter-framework/typescript-emitter.ts