Skip to content

How can I create an instantiation of a template type using compiler API in a decorator? #3328

Answered by timotheeguerin
Veetaha asked this question in Q&A
Discussion options

You must be logged in to vote

Yeah resolveTypeReference is explicitly designed to not instantiate further templates(readonly). I don't think we have a good API for this.

But seeing this is to simplify the @JsonSchema.extension decorator i think there is a few things:

  1. we have a new way of defining values in TypeSpec(coming next version) and part of this would be not requiring the Json<T> wrapper for values in this decorator. However that is a breaking change(to change that specific decorator) and we haven't decided yet if we'll take it.
  2. We could consider exporting the setter directly instead so you don't have to call another decorator and build this dummy ojbect just for that

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Veetaha
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants