@typespec/http 0.46.0-dev.5 → 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.
@@ -10,6 +10,7 @@ model HeaderOptions {
10
10
  * Name of the header when sent over http.
11
11
  */
12
12
  name?: string;
13
+
13
14
  /**
14
15
  * Determines the format of the array if type array is used.
15
16
  */
@@ -20,6 +21,7 @@ model HeaderOptions {
20
21
  * Specify this property is to be sent or received as an http header.
21
22
  *
22
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`)
23
25
  *
24
26
  * @example
25
27
  *
@@ -27,6 +29,13 @@ model HeaderOptions {
27
29
  * op read(@header accept: string): {@header("E-Tag") eTag: string};
28
30
  * op create(@header({name: "X-Color", format: "csv"}) colors: string[]): void;
29
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
+ * ```
30
39
  */
31
40
  extern dec header(target: ModelProperty, headerNameOrOptions?: string | HeaderOptions);
32
41
 
@@ -38,6 +47,7 @@ model QueryOptions {
38
47
  * Name of the query when included in the url.
39
48
  */
40
49
  name?: string;
50
+
41
51
  /**
42
52
  * Determines the format of the array if type array is used.
43
53
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typespec/http",
3
- "version": "0.46.0-dev.5",
3
+ "version": "0.46.0-dev.7",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec HTTP protocol binding",
6
6
  "homepage": "https://github.com/microsoft/typespec",