I'd like to make a property visible for openapi but hidden to a custom emitter - how would I do that? #2511
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @Kieranties that's awesome to hear you trying to write an emitter for typespec! For your question it is a good one, we think your approach is a correct way of representing it, we talked a little bit with the team and sounds like we have probably a bug/some change to do in the http library regarding that body resolution. I filed an issue for that part #2513 Taking a step back however: |
Beta Was this translation helpful? Give feedback.
-
Huge thanks for the feedback and validation. Writing the emitter has been a good challenge to flex in a new space for me. And it's been working great! Your response on spreading the model is spot on. That's exactly what I have set up. This was a contrived example, but I have an authoriser project that creates a lambda and a typespec package that models its request requirements. Other lambdas then consume the package and add the model to their operation by spreading it in, or extending |
Beta Was this translation helpful? Give feedback.
Hi @Kieranties that's awesome to hear you trying to write an emitter for typespec!
For your question it is a good one, we think your approach is a correct way of representing it, we talked a little bit with the team and sounds like we have probably a bug/some change to do in the http library regarding that body resolution. I filed an issue for that part #2513
Taking a step back however:
Is that header combo always the same? At least the lambda converted name? Could that name be automatically resolved by the emitter, I feel like that if you require user to do that it might be quite error prone. That could probably be mitigated with some template model that you spread to get those propertie…