For now create a component along the lines of SpringServiceEndpoint which will take a TypeSpec Operation.
An operation represents a service endpoint. The basis of this component should be building a RouteHandler from a TypeSpec Operation. It should be able to query all http decorators from the operations, and pass them to the RouteHandler with the respective annotations.
Operations seem to take their arguments in the form of a Model, and each argument to the function is a ModelProperty. Each of these ModelProperty has a decorator applied.
Look at the @typespec/http library which should have some useful methods to query these decorators off operations etc. Look at the TypeKits availabile too as those might be of help.
Should aim to implement all HTTP verbs:
@get
@post
@put
@delete
@head
@patch
Should aim to implement passing data to the route through
@header
@body
@query
That is all the decorators that should need to be focused on for now. Most will correspond to passing an annotation in some way, either on the Java method or on paramters to the method. Consult the spring-boot docs for how to implement each of these things in Spring, then you can map each decorator to the spring equivalent.
Don't hesitate to reach out to the Microsoft team for help if needed (Or Jamin)
For now create a component along the lines of
SpringServiceEndpoint
which will take a TypeSpecOperation
.An operation represents a service endpoint. The basis of this component should be building a
RouteHandler
from a TypeSpecOperation
. It should be able to query all http decorators from the operations, and pass them to theRouteHandler
with the respective annotations.Study https://typespec.io/docs/language-basics/operations and https://typespec.io/docs/libraries/http/reference/decorators for the type of decorators that will be applied.
Operations seem to take their arguments in the form of a
Model
, and each argument to the function is aModelProperty
. Each of theseModelProperty
has a decorator applied.Look at the
@typespec/http
library which should have some useful methods to query these decorators off operations etc. Look at the TypeKits availabile too as those might be of help.Should aim to implement all HTTP verbs:
@get
@post
@put
@delete
@head
@patch
Should aim to implement passing data to the route through
@header
@body
@query
That is all the decorators that should need to be focused on for now. Most will correspond to passing an annotation in some way, either on the Java method or on paramters to the method. Consult the spring-boot docs for how to implement each of these things in Spring, then you can map each decorator to the spring equivalent.
Don't hesitate to reach out to the Microsoft team for help if needed (Or Jamin)