Replies: 2 comments 1 reply
-
you can definitely do that, TypeSpec was designed with this scenario in mind. You do have to be mindful of course of how certain protocol might require certain structure(specially around operations) so you don't affect others but otherwise it should definitely work. We have this example here showcasing multiple emitters https://typespec.io/multi-protocol |
Beta Was this translation helpful? Give feedback.
-
I have a specific question related to this. If I want to use the
This results in an error that I haven't specified a field for this. But I don't really want to because really the status code should be a decorator on the model, not a field within the model. In any case adding a
Even in this case it will still emit the |
Beta Was this translation helpful? Give feedback.
-
Hi, there. I'm new to typespec and I'd like to use typespec for defining messaging protos for my project. I'm using restful api for message between my frontend and my api server, and protobuf for my api server and other microservices.
I'm wondering if I can reuse models and enums to emitting different representations for openapi and protobuf. For example:
Beta Was this translation helpful? Give feedback.
All reactions