@typespec/http-specs 0.1.0-alpha.33-dev.0 → 0.1.0-alpha.33-dev.3

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@typespec/http-specs",
3
3
  "displayName": "Http Specs",
4
- "version": "0.1.0-alpha.33-dev.0",
4
+ "version": "0.1.0-alpha.33-dev.3",
5
5
  "description": "Spec scenarios and mock apis",
6
6
  "main": "dist/index.js",
7
7
  "type": "module",
@@ -54,7 +54,7 @@
54
54
  "validate-scenarios": "tsp-spector validate-scenarios ./specs",
55
55
  "generate-scenarios-summary": "tsp-spector generate-scenarios-summary ./specs",
56
56
  "regen-docs": "pnpm generate-scenarios-summary",
57
- "upload-manifest": "tsp-spector upload-manifest ./specs --setName @typespec/http-specs --containerName manifests-typespec --storageAccountName typespec",
57
+ "upload-manifest": "tsp-spector upload-manifest ./specs --containerName coverages --storageAccountName typespec --manifestName http-specs",
58
58
  "upload-coverage": "tsp-spector upload-coverage --generatorName @typespec/http-specs --generatorVersion 0.1.0-alpha.4 --containerName coverages --generatorMode standard --storageAccountName typespec",
59
59
  "validate-mock-apis": "tsp-spector validate-mock-apis ./specs",
60
60
  "check-scenario-coverage": "tsp-spector check-coverage ./specs",
package/spec-summary.md CHANGED
@@ -3061,6 +3061,32 @@ Expected request body:
3061
3061
  </ModelWithAttributes>
3062
3062
  ```
3063
3063
 
3064
+ ### Payload_Xml_ModelWithDatetimeValue_get
3065
+
3066
+ - Endpoint: `get /payload/xml/modelWithDatetime`
3067
+
3068
+ Expected response body:
3069
+
3070
+ ```xml
3071
+ <ModelWithDatetime>
3072
+ <rfc3339>2022-08-26T18:38:00.000Z</rfc3339>
3073
+ <rfc7231>Fri, 26 Aug 2022 14:38:00 GMT</rfc7231>
3074
+ </ModelWithDatetime>
3075
+ ```
3076
+
3077
+ ### Payload_Xml_ModelWithDatetimeValue_put
3078
+
3079
+ - Endpoint: `put /payload/xml/modelWithDatetime`
3080
+
3081
+ Expected request body:
3082
+
3083
+ ```xml
3084
+ <ModelWithDatetime>
3085
+ <rfc3339>2022-08-26T18:38:00.000Z</rfc3339>
3086
+ <rfc7231>Fri, 26 Aug 2022 14:38:00 GMT</rfc7231>
3087
+ </ModelWithDatetime>
3088
+ ```
3089
+
3064
3090
  ### Payload_Xml_ModelWithDictionaryValue_get
3065
3091
 
3066
3092
  - Endpoint: `get /payload/xml/modelWithDictionary`
@@ -3157,6 +3183,30 @@ Expected request body:
3157
3183
  </ModelWithEncodedNamesSrc>
3158
3184
  ```
3159
3185
 
3186
+ ### Payload_Xml_ModelWithEnumValue_get
3187
+
3188
+ - Endpoint: `get /payload/xml/modelWithEnum`
3189
+
3190
+ Expected response body:
3191
+
3192
+ ```xml
3193
+ <ModelWithEnum>
3194
+ <status>success</status>
3195
+ </ModelWithEnum>
3196
+ ```
3197
+
3198
+ ### Payload_Xml_ModelWithEnumValue_put
3199
+
3200
+ - Endpoint: `put /payload/xml/modelWithEnum`
3201
+
3202
+ Expected request body:
3203
+
3204
+ ```xml
3205
+ <ModelWithEnum>
3206
+ <status>success</status>
3207
+ </ModelWithEnum>
3208
+ ```
3209
+
3160
3210
  ### Payload_Xml_ModelWithOptionalFieldValue_get
3161
3211
 
3162
3212
  - Endpoint: `get /payload/xml/modelWithOptionalField`
@@ -82,6 +82,36 @@ model ModelWithEncodedNames {
82
82
  @encodedName("application/xml", "PossibleColors") colors: string[];
83
83
  }
84
84
 
85
+ @doc("Status values for the model with enum.")
86
+ union Status {
87
+ string,
88
+
89
+ @doc("Pending status.")
90
+ pending: "pending",
91
+
92
+ @doc("Success status.")
93
+ success: "success",
94
+
95
+ @doc("Error status.")
96
+ error: "error",
97
+ }
98
+
99
+ @doc("Contains a single property with an enum value.")
100
+ model ModelWithEnum {
101
+ status: Status;
102
+ }
103
+
104
+ @doc("Contains datetime properties with different encodings.")
105
+ model ModelWithDatetime {
106
+ @encode(DateTimeKnownEncoding.rfc3339)
107
+ @doc("DateTime value with rfc3339 encoding.")
108
+ rfc3339: utcDateTime;
109
+
110
+ @encode(DateTimeKnownEncoding.rfc7231)
111
+ @doc("DateTime value with rfc7231 encoding.")
112
+ rfc7231: utcDateTime;
113
+ }
114
+
85
115
  @doc("An error response body in XML format.")
86
116
  @error
87
117
  model XmlError {
@@ -315,6 +345,31 @@ interface ModelWithEncodedNamesValue
315
345
  """
316
346
  > {}
317
347
 
348
+ @doc("Operations for the ModelWithEnum type.")
349
+ @route("/modelWithEnum")
350
+ interface ModelWithEnumValue
351
+ extends XmlOperations<
352
+ ModelWithEnum,
353
+ """
354
+ <ModelWithEnum>
355
+ <status>success</status>
356
+ </ModelWithEnum>
357
+ """
358
+ > {}
359
+
360
+ @doc("Operations for the ModelWithDatetime type.")
361
+ @route("/modelWithDatetime")
362
+ interface ModelWithDatetimeValue
363
+ extends XmlOperations<
364
+ ModelWithDatetime,
365
+ """
366
+ <ModelWithDatetime>
367
+ <rfc3339>2022-08-26T18:38:00.000Z</rfc3339>
368
+ <rfc7231>Fri, 26 Aug 2022 14:38:00 GMT</rfc7231>
369
+ </ModelWithDatetime>
370
+ """
371
+ > {}
372
+
318
373
  @doc("Operations that return an error response in XML format.")
319
374
  @route("/error")
320
375
  interface XmlErrorValue {
@@ -123,6 +123,19 @@ export const modelWithEncodedNames = `
123
123
  </ModelWithEncodedNamesSrc>
124
124
  `;
125
125
 
126
+ export const modelWithEnum = `
127
+ <ModelWithEnum>
128
+ <status>success</status>
129
+ </ModelWithEnum>
130
+ `;
131
+
132
+ export const modelWithDatetime = `
133
+ <ModelWithDatetime>
134
+ <rfc3339>2022-08-26T18:38:00.000Z</rfc3339>
135
+ <rfc7231>Fri, 26 Aug 2022 14:38:00 GMT</rfc7231>
136
+ </ModelWithDatetime>
137
+ `;
138
+
126
139
  function createServerTests(uri: string, data?: any) {
127
140
  return {
128
141
  get: passOnSuccess({
@@ -234,6 +247,17 @@ const Payload_Xml_ModelWithEncodedNames = createServerTests(
234
247
  Scenarios.Payload_Xml_ModelWithEncodedNamesValue_get = Payload_Xml_ModelWithEncodedNames.get;
235
248
  Scenarios.Payload_Xml_ModelWithEncodedNamesValue_put = Payload_Xml_ModelWithEncodedNames.put;
236
249
 
250
+ const Payload_Xml_ModelWithEnum = createServerTests("/payload/xml/modelWithEnum", modelWithEnum);
251
+ Scenarios.Payload_Xml_ModelWithEnumValue_get = Payload_Xml_ModelWithEnum.get;
252
+ Scenarios.Payload_Xml_ModelWithEnumValue_put = Payload_Xml_ModelWithEnum.put;
253
+
254
+ const Payload_Xml_ModelWithDatetime = createServerTests(
255
+ "/payload/xml/modelWithDatetime",
256
+ modelWithDatetime,
257
+ );
258
+ Scenarios.Payload_Xml_ModelWithDatetimeValue_get = Payload_Xml_ModelWithDatetime.get;
259
+ Scenarios.Payload_Xml_ModelWithDatetimeValue_put = Payload_Xml_ModelWithDatetime.put;
260
+
237
261
  export const xmlError = `
238
262
  <XmlErrorBody>
239
263
  <message>Something went wrong</message>