@typespec/http 0.46.0-dev.6 → 0.46.0-dev.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/http-decorators.tsp +8 -0
- package/package.json +1 -1
package/lib/http-decorators.tsp
CHANGED
|
@@ -21,6 +21,7 @@ model HeaderOptions {
|
|
|
21
21
|
* Specify this property is to be sent or received as an http header.
|
|
22
22
|
*
|
|
23
23
|
* @param headerNameOrOptions Optional name of the header when sent over http or header options.
|
|
24
|
+
* By default the header name will be the property name converted from camelCase to camel-case. (e.g. `eTag` -> `e-tag`)
|
|
24
25
|
*
|
|
25
26
|
* @example
|
|
26
27
|
*
|
|
@@ -28,6 +29,13 @@ model HeaderOptions {
|
|
|
28
29
|
* op read(@header accept: string): {@header("E-Tag") eTag: string};
|
|
29
30
|
* op create(@header({name: "X-Color", format: "csv"}) colors: string[]): void;
|
|
30
31
|
* ```
|
|
32
|
+
*
|
|
33
|
+
* @example Implicit header name
|
|
34
|
+
*
|
|
35
|
+
* ```typespec
|
|
36
|
+
* op read(): {@header eTag: string}; // headerName: e-tag
|
|
37
|
+
* op read(): {@header contentType: string}; // headerName: content-type
|
|
38
|
+
* ```
|
|
31
39
|
*/
|
|
32
40
|
extern dec header(target: ModelProperty, headerNameOrOptions?: string | HeaderOptions);
|
|
33
41
|
|