You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE: If multiple method arguments are involved, you may need to apply multiple bindings. This can be done by adding a new //kok:param directive, or by appending the binding to the end of the last //kok:param directive in a semicolon-separated list.
Example
After the above syntax improvements, here are the equivalent annotations:
One binding per //kok:param
typeServiceinterface {
//kok:op POST /users//kok:param name//kok:param age in=query//kok:param ip in=header name=X-Forwarded-For, in=request name=RemoteAddrCreateUser(ctx context.Context, namestring, ageint, ip net.IP) (errerror)
}
// HTTP request:// $ http POST /users?name=tracey&age=1
Multiple bindings in a single //kok:param
typeServiceinterface {
//kok:op POST /users//kok:param name; age in=query; ip in=header name=X-Forwarded-For, in=request name=RemoteAddrCreateUser(ctx context.Context, namestring, ageint, ip net.IP) (errerror)
}
// HTTP request:// $ http POST /users?name=tracey&age=1
Multiple bindings in a single //kok:param (but using backslash for better readability)
typeServiceinterface {
//kok:op POST /users//kok:param name; \// age in=query; \// ip in=header name=X-Forwarded-For, in=request name=RemoteAddrCreateUser(ctx context.Context, namestring, ageint, ip net.IP) (errerror)
}
// HTTP request:// $ http POST /users?name=tracey&age=1
The text was updated successfully, but these errors were encountered:
Syntax improvements
Original syntax (after #18):
//kok:param <argName> [<parameter> [; <parameter2> [; ...]]]
in=<in> name=<name> required=<required> type=<type> descr=<descr>
New syntax:
//kok:param <argName> [<parameter> [, <parameter2> [, ...]]]
in=<in> name=<name> required=<required> type=<type> descr=<descr>
//kok:param
directive, or by appending the binding to the end of the last//kok:param
directive in a semicolon-separated list.Example
After the above syntax improvements, here are the equivalent annotations:
One binding per //kok:param
Multiple bindings in a single //kok:param
Multiple bindings in a single //kok:param (but using backslash for better readability)
The text was updated successfully, but these errors were encountered: